Script Preparation code:
AخA
 
var arr = Array(500).fill('test')
Tests:
  • flatmap

     
    arr.flatMap((x) => [x, x])
  • map+flat

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

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    flatmap
    map+flat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Firefox 129 on Linux
View result in a separate tab
Test name Executions per second
flatmap 82430.5 Ops/sec
map+flat 76540.1 Ops/sec