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

Revision 33 of this benchmark created by Marcin on


Setup

var args = [1,2,3,4,5]
  
  var f = function(){
    return this;
  };
  
  var that = {};
  
  var bound = f.bind(that);

Test runner

Ready to run.

Testing in
TestOps/sec
direct
f(1,2,3,4,5);
ready
apply
f.apply(that, arguments);
ready
call
f.call(that,1,2,3,4,5);
ready
bind
bound(1,2,3,4,5);
ready

Revisions

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