flatMap vs reduce with push vs loop with push vs filter with a mapFastest: loop with push (4.5x faster)
14,200 ops/sec
12,274 ops/sec
11,328 ops/sec
3,137 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| flatMap | |
| reduce with push | |
| loop with push | |
| filter with a map |
| Test name | Executions per second |
|---|---|
| ✓ loop with push | 7,244 Ops/sec |
| reduce with push | 2,302 Ops/sec |
| filter with a map | 1,548 Ops/sec |
| flatMap | 1,307 Ops/sec |