Script Preparation code:
x
 
var arr = [];
var i = 0;
while (i <= 1E5) arr[i] = i++;
Tests:
  • filter().map()

     
    arr.filter(x => x % 3).map(x => x/100)
  • flatMap()

     
    arr.flatMap(x => x % 3 ? [x/100] : [])
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Firefox 135 on Linux
View result in a separate tab
Test name Executions per second
filter().map() 957.2 Ops/sec
flatMap() 474.8 Ops/sec