Test name | Executions per second |
---|---|
invoke bound | 131188888.0 Ops/sec |
invoke closure | 121384728.0 Ops/sec |
invoke boundThis | 130676576.0 Ops/sec |
var a = {v : Math.random()}
var bound = (function(a_) {
a_.v = Math.imul(2, a_.v);
}).bind(null, a);
var boundThis = (function() {
this.v = Math.imul(2, this.v);
}).bind(a);
var closure = (function() {
const a_ = a;
return function() {
a_.v = Math.imul(2, a_.v);
};
})();
bound();
closure();
boundThis();