Script Preparation code:
x
 
let i = 0;
function init() {
  i++;
}
const obj = {
  i: 0,
  init: function() {
    this.i++;
  }
};
class sample {
  constructor() {
    this.i = 0;
    this.init();
  }
  init() {
    this.i++;
  }
}
const cls = new sample();
Tests:
  • class

     
    cls.init();
  • object

     
    obj.init();
  • function

     
    init();
  • extra: for i

     
    for (let i=0; i<1; i++)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    class
    object
    function
    extra: for i

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0
Chrome 133 on Windows
View result in a separate tab
Test name Executions per second
class 199197504.0 Ops/sec
object 196554864.0 Ops/sec
function 193521120.0 Ops/sec
extra: for i 176454960.0 Ops/sec