Script Preparation code:
AخA
 
var testVar = 10;
Tests:
  • Cache in the inner scope

     
    function doTest1(){
      var sum = 0;
      for (var i = 0; i < testVar; i++){
        sum = sum + i;
      }
    }
    doTest1();
  • Do not cache at all

     
    function doTest2(){
      var sum = 0;
      var testVarLocal = testVar;
      for (var i = 0; i < testVarLocal; i++){
        sum = sum + i;
      }
    }
    doTest2();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Cache in the inner scope
    Do not cache at all

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Cache in the inner scope 888428.9 Ops/sec
Do not cache at all 8109436.5 Ops/sec