function calls: direct vs apply vs call vs bind (v36)

Revision 36 of this benchmark created by harry on


Setup

var f = function() {
      this.dirty = true;
    };
    
    var that = {};
    
    var bound = f.bind(that);

Test runner

Ready to run.

Testing in
TestOps/sec
direct
f();
ready
apply
f.apply(that);
ready
call
f.call(that);
ready
bind
bound();
ready
no func
f.dirty = true;
ready

Revisions

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