Script Preparation code:
AخA
 
var result = 0;
var data = [0, 1, 2, 3, 4 ,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19];
Tests:
  • One For Loop

     
    for (var i = 0, l = data.length; i < l; i++) {
      result += data[i];
      result -= (data[i] - 1);
      result *= data[i];
    }
  • Multiple For Loop

     
    for (var i = 0, l = data.length; i < l; i++) {
      result += data[i];
    }
    for (var i = 0, l = data.length; i < l; i++) {
      result -= (data[i] - 1);
    }
    for (var i = 0, l = data.length; i < l; i++) {
      result *= data[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    One For Loop
    Multiple For Loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2025 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36
Chrome 64 on Linux
View result in a separate tab
Test name Executions per second
One For Loop 69057.0 Ops/sec
Multiple For Loop 68540.7 Ops/sec