flatMap vs reduce with push vs loop with pushFastest: reduce with push (4.1x faster)
21,836 ops/sec
18,724 ops/sec
5,379 ops/sec
Fastest: loop with push (2.6x faster)
13,473 ops/sec
12,536 ops/sec
5,210 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 |
| Test name | Executions per second |
|---|---|
| ✓ loop with push | 53,808 Ops/sec |
| reduce with push | 29,985 Ops/sec |
| flatMap | 7,536 Ops/sec |