bind vs closure (v34)

Revision 34 of this benchmark created on


Setup

var binded = this.foo.bind(this);
  var o = {
    foo: function() {
  
    },
    fee: function() {
      this.fum(binded);
    },
    fi: function() {
      this.fum(this._foo);
    },
    fo: function() {
      this.fum(function() {});
    },
    fum: function(f) {
  
    }
  };
  
  o._foo = o.foo.bind(o);

Test runner

Ready to run.

Testing in
TestOps/sec
bind
o.fee();
ready
cached bind
o.fi();
ready
closure
o.fo();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.