Forward or Backward?

Benchmark created by Kent Brewster on


Description

Is it really faster to run those loops backwards?

Test runner

Ready to run.

Testing in
TestOps/sec
Backwards
for (var i = 8675309; i > 0; i--) {
 var t = i;
}
ready
Forwards
for (var i = 0; i < 8675309; i++) {
 var t = i;
}
ready

Revisions

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

  • Revision 1: published by Kent Brewster on