Tests:
  • Concat

    AخA
     
    var params = [ "hello", true, 7 ];
    var other = [ 1, 2 ].concat(params);
  • Spread

     
    var params = [ "hello", true, 7 ]
    var other = [ 1, 2, ...params ]
  • Unshift each

     
    var params = [ "hello", true, 7 ];
    params.unshift(2);
    params.unshift(1);
  • Unshift together

     
    var params = [ "hello", true, 7 ];
    params.unshift(1, 2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Concat
    Spread
    Unshift each
    Unshift together

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121 on Windows
View result in a separate tab
Test name Executions per second
Concat 2461570.5 Ops/sec
Spread 9353793.0 Ops/sec
Unshift each 2749104.2 Ops/sec
Unshift together 3475182.5 Ops/sec