foreach call vs prototype-call (v2)

Revision 2 of this benchmark created on


Setup

var callbacks = [];
    for (var i = 0; i < 10; i++) {
      callbacks.push(function() { });
    }
    var pcall = Function.prototype.call;

Test runner

Ready to run.

Testing in
TestOps/sec
basic
callbacks.forEach(function(cb) {
  cb();
});
ready
Function.prototype.call
callbacks.forEach(Function.prototype.call, Function.prototype.call);
ready
Function.prototype.call with lookup hoisted
callbacks.forEach(pcall, pcall);
ready

Revisions

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