Script Preparation code:
AخA
 
var list = [];
for (var i = 0; i < 1000 * 1000; i++) {
  list.push(i);
}
Tests:
  • slice

    x
     
    list = [...list.slice(0, 500), 9999, ...list.slice(500)];
  • splice

     
    const newList = list;
    newList.splice(500, 0, 9999);
    list = newList;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    slice
    splice

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 months ago)
Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Firefox 125 on Linux
View result in a separate tab
Test name Executions per second
slice 85.4 Ops/sec
splice 1491.2 Ops/sec