bind vs closure (v26)

Revision 26 of this benchmark created on


Setup

var o = {
      foo: function() {
    
      },
      fee: function() {
        this.fum(this.foo.bind(this));
      },
      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.