Script Preparation code:
AخA
 
var arr = new Array(100000).fill(1);
Tests:
  • Test flatMap

     
    arr.flatMap(() => [1, 2]);
  • Test map/flat

     
    arr.map(() => [1, 2]).flat();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Test flatMap
    Test map/flat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Test flatMap 529.3 Ops/sec
Test map/flat 110.6 Ops/sec