Test name | Executions per second |
---|---|
bind | 698409.9 Ops/sec |
arrow | 931656.1 Ops/sec |
class A {
execute() {
}
callback1() {}
callback2() {}
}
window.a = new A();
a.execute = function () {
let bound1 = this.callback1.bind(this);
let bound2 = this.callback2.bind(this);
bound1();
bound2();
}
a.execute();
a.execute = function () {
let bound1 = () => this.callback1();
let bound2 = () => this.callback2();
bound1();
bound2();
}
a.execute();