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

     
    list.push('slice');
    list = list.slice(1);
  • splice

     
    list.push('splice');
    list.splice(0, 1);
  • shift

     
    list.push('splice');
    list.shift();
  • indexed

     
    list[idx] = 'splice';
    idx = (idx++) % list.length;
    // Needs some formatting when you actually need to use the list
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    slice
    splice
    shift
    indexed

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62
Chrome 98 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
slice 130.4 Ops/sec
splice 5490.6 Ops/sec
shift 745.7 Ops/sec
indexed 934829.8 Ops/sec