Script Preparation code:
AخA
 
var array = [];
(function () {
  var length = 100;
  while (length--) {
    array.push(Math.random());
  }
})();
Tests:
  • for loop

    x
     
    var i = 0;
    var length = array.length;
    for (; i < length; i++) {
      array[i]++;
    }
  • reverse while loop

     
    var i = array.length;
    while (i--) {
      array[i]++;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for loop
    reverse while loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Windows
View result in a separate tab
Test name Executions per second
for loop 202494.4 Ops/sec
reverse while loop 200676.0 Ops/sec