Script Preparation code:
x
 
var a = [];
for (var i=0; i < 1000000;i++){
  a.push("item"+i);
}
Tests:
  • Length = 0

     
    a.length = 0;
  • Splice

     
    a.splice(0, a.length-1);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Length = 0
    Splice

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Length = 0 39319436.0 Ops/sec
Splice 53635176.0 Ops/sec