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

Revision 82 of this benchmark created by Roland Pihlakas on


Setup

var f = function(){
    return this;
  };
  
  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
apply-like call, unknown arguments
obj.foo.call(obj, b[0], b[1], b[2]);
ready

Revisions

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