foreach call vs prototype-call (v3)

Revision 3 of this benchmark created on


Setup

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

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
Straight For Loop
for (var i = 0; i < callbacks.length; i++) {
            callbacks[i]();                
}
ready

Revisions

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