Script Preparation code:
Tests:
  • repeated spread -- output = [...output, ...batch]

  • repeated concat -- output = output.concat(batch)

  • spread concat -- output = [].concat(...batches)

  • push spread -- output.push(...batch)

  • push loop -- for (const v of batch) { output.push(v) }

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    repeated spread -- output = [...output, ...batch]
    repeated concat -- output = output.concat(batch)
    spread concat -- output = [].concat(...batches)
    push spread -- output.push(...batch)
    push loop -- for (const v of batch) { output.push(v) }

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 21 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
repeated spread -- output = [...output, ...batch] 2710.8 Ops/sec
repeated concat -- output = output.concat(batch) 7952.2 Ops/sec
spread concat -- output = [].concat(...batches) 257649.8 Ops/sec
push spread -- output.push(...batch) 37212.6 Ops/sec
push loop -- for (const v of batch) { output.push(v) } 40958.9 Ops/sec