Script Preparation code:
AخA
 
var arr = [];
var count = 100000;
for(var i = 0; i<count; i++)
{
  arr.push(i);
}
Tests:
  • Cache length

     
    var arrLen = arr.length;
    var sum = 0;
    for (var i = 0; i < arrLen; i++){
      sum = arr[i];
    }
  • Do not cache

     
    var sum = 0;
    for (var i in arr){
      sum = arr[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Cache length
    Do not cache

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1
Mobile Safari 13 on iOS 13.2
View result in a separate tab
Test name Executions per second
Cache length 126.9 Ops/sec
Do not cache 120.0 Ops/sec