Loop Test (Custom events) (v3)

Revision 3 of this benchmark created by John-David Dalton on


Preparation HTML

<script>
  var handlers = [
  
  function() {}, function() {}, function() {}, function() {}, function() {}, function() {}, function() {}, function() {}, function() {}, function() {}];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
for
for (var i = 0, len = handlers.length; i < len; i++) {
 if (handlers[i]() === false) {}
}
ready
while
var length = handlers.length;
while (length--) {
 if (handlers[length]() === false) {}
}
ready
assign
var handler, i = -1;
while (handler = handlers[++i]) {
 if (handler() === false) {}
}
ready
assign2
var handler, i = 0;
while (handler = handlers[i++]) {
 if (handler() === false) {}
}
ready
assign3
for (var i = 0, handler; handler = handlers[i]; i++) {
 if (handler() === false) {}
}
ready

Revisions

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

  • Revision 1: published by John-David Dalton on
  • Revision 3: published by John-David Dalton on