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

Revision 48 of this benchmark created by Thomas Jensen on


Setup

var that = {};
    
    var f = function(){
      return this;
    };
    
    var fx = function( that ){
      return that;
    };
    
    var bound = f.bind(that);

Test runner

Ready to run.

Testing in
TestOps/sec
direct
fx();
ready
apply
f.apply(that);
ready
call
f.call(that);
ready
bind
bound();
ready

Revisions

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