Script Preparation code:
AخA
 
var data = [];
for (let i = 0; i < 10000; ++i) data[i] = i;
var add = [];
for (let i = 0; i < 100; ++i) add[i] = -i;
Tests:
  • unshift

     
    data.unshift(...add);
  • splice

     
    data.splice(0, 0, ...add)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    unshift
    splice

    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; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118 on Windows
View result in a separate tab
Test name Executions per second
unshift 5409.1 Ops/sec
splice 109.7 Ops/sec