Script Preparation code:
AخA
 
var array = new Array(1);
Tests:
  • for

     
    for (var i = 0; i < array.length; i++) {
      array[i];
    }
  • foreach

     
    array.forEach(function(i) {
      array[i];
    });
  • for in

     
    for (var i in array) {
      array[i];
    }
  • for..of

     
    for (var i of array) {
      array[i];
    }
  • for (cache length

     
    const length = array.length
    for (var i = 0; i < length; i++) {
      array[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for
    foreach
    for in
    for..of
    for (cache length

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 days ago)
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Chrome 132 on Chrome OS 14541.0.0
View result in a separate tab
Test name Executions per second
for 15428524.0 Ops/sec
foreach 14520560.0 Ops/sec
for in 3287515.5 Ops/sec
for..of 9296124.0 Ops/sec
for (cache length 16183961.0 Ops/sec