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

Revision 26 of this benchmark created on


Setup

var f = function(){
      return this;
    };
    
    var that = {};
    
    var bound = f.bind(that);
    
    var bound2 = function(){
    f.call(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
direct2
f(that);
ready
bind2
bound2()
ready

Revisions

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