Script Preparation code:
x
 
var x = 0;
function doSomething(x) {
  return x++;
}
Tests:
  • A

     
    for(var i=0; i < 1000000; i++) {
      (function(someValue) {
        return x++;
      })(i);
    }
  • B

     
    for(var i=0; i < 1000000; i++) {
      doSomething(i);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    A
    B

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Linux
View result in a separate tab
Test name Executions per second
A 8.9 Ops/sec
B 22.3 Ops/sec