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 |
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();
cls.init();
obj.init();
init();
for (let i=0; i<1; i++)