Script Preparation code:
x
 
var list = new Array(10*1000);
for (var i = 0; i < 10 * 1000; i++) {
  list[i]= i * Math.random();
}
Tests:
  • slice

     
    while(list.length) {
      list = list.slice(1)
    }
  • shift

     
    while(list.length) {
      list.shift()
    }
  • splice

     
    while(list.length) {
      list.splice(0,1)
    }
  • delete

     
    let i = 0
    let ln= list.length
    while (i < ln) {
        list[i];
        delete list[i];
        i++
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    slice
    shift
    splice
    delete

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0
Firefox 85 on Windows
View result in a separate tab
Test name Executions per second
slice 66908532.0 Ops/sec
shift 231062272.0 Ops/sec
splice 224277136.0 Ops/sec
delete 82615032.0 Ops/sec