Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Waterfox/56.3
Firefox 56
Windows 7
Desktop
5 years ago
Test name Executions per second
invoke bound 131188888.0 Ops/sec
invoke closure 121384728.0 Ops/sec
invoke boundThis 130676576.0 Ops/sec
Script Preparation code:
x
 
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);
  };
})();
Tests:
  • invoke bound

     
    bound();
  • invoke closure

     
    closure();
  • invoke boundThis

     
    boundThis();