Script Preparation code:
AخA
 
var array = Array.from({ length: 100 }).map((val, i) => i);
Tests:
  • Splice

     
    var newArray = array.splice(0, 0, 99);
  • Spread

     
    var newArray = [99, ...array];
  • Unshift

     
    var newArray = array.unshift(99);
  • Concat

     
    var newArray = [99].concat(array);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Splice
    Spread
    Unshift
    Concat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
Firefox 109 on Windows
View result in a separate tab
Test name Executions per second
Splice 5515.1 Ops/sec
Spread 132.0 Ops/sec
Unshift 532847.2 Ops/sec
Concat 20.6 Ops/sec