Script Preparation code:
x
 
// preparation
var a = Array.from({length: 1000}).map((_, i)=>`${i}`);
var b = Array.from({length: 2000}).map((_, i)=>`${i}`);
var aSmall = ['a', 'b', 'c', 'd'];
var bSmall = ['e', 'f', 'g', 'h', 'i'];
Tests:
  • Array.prototype.concat small

     
    aSmall.concat(bSmall);
  • spread operator (small)

     
    [...aSmall, ...bSmall]
  • Array.prototype.concat (large)

     
    a.concat(b);
  • spread operator (large)

     
    [...a, ...b]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.prototype.concat small
    spread operator (small)
    Array.prototype.concat (large)
    spread operator (large)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36
Chrome Mobile 128 on Android
View result in a separate tab
Test name Executions per second
Array.prototype.concat small 3713005.8 Ops/sec
spread operator (small) 6207353.5 Ops/sec
Array.prototype.concat (large) 378036.7 Ops/sec
spread operator (large) 73231.6 Ops/sec