function calls: apply, call, and arguments (v11)

Revision 11 of this benchmark created on


Setup

var Obj = function() {};
  Obj.prototype.f = function() { return this; };
  Obj.prototype.f1 = function() { return this.f(1); };
  Obj.prototype.f2 = function() { return this.f.apply(this, [1]); };
  Obj.prototype.f3 = function() { return this.f.apply(this, arguments); };
  
  var obj = new Obj();

Test runner

Ready to run.

Testing in
TestOps/sec
direct
obj.f1();
ready
apply
obj.f2();
ready
apply with arguments
obj.f3(1);
ready

Revisions

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