Script Preparation code:
AخA
 
var arr = Array(10_000).fill(0)
Tests:
  • reduce with concat

     
    arr.reduce((acc, x) => {acc.push(x, x); return acc}, [])
  • flatMap

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

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    reduce with concat
    flatMap

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0
Firefox 124 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
reduce with concat 5664.4 Ops/sec
flatMap 4488.0 Ops/sec