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

Revision 12 of this benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
direct
obj.f1(1);
ready
apply
obj.f2(1);
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.