filter().map() vs flatMap()Fastest: flatMap() (1.2x faster)
698 ops/sec
572 ops/sec
Fastest: filter().map() (1.1x faster)
756 ops/sec
676 ops/sec
Fastest: flatMap() (1.9x faster)
1,867 ops/sec
960 ops/sec
Fastest: filter().map() (2.0x faster)
459 ops/sec
231 ops/sec
Fastest: filter().map() (1.3x faster)
2,839 ops/sec
2,251 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| filter().map() | |
| flatMap() |
| Test name | Executions per second |
|---|---|
| ✓ flatMap() | 1,001 Ops/sec |
| filter().map() | 869 Ops/sec |