Script Preparation code:
Tests:

Historical Performance Data aggregated from 6 community runs

Desktop Results:
Chrome 6 runs
map().filter()
108.4M/s
filter().map()
106.9M/s
flatMap()
52.7M/s

Fastest: map().filter() (2.1x faster)

View exact numbers
  • map().filter(): 108,442,112 ops/sec
  • filter().map(): 106,865,296 ops/sec
  • flatMap(): 52,657,052 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    map().filter()
    flatMap()
    filter().map()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138 on Windows
View result in a separate tab
map().filter()
17/s
filter().map()
15/s
flatMap()
12/s
View exact numbers
Test name Executions per second
map().filter() 17 Ops/sec
filter().map() 15 Ops/sec
flatMap() 12 Ops/sec