loop descendening

Benchmark created by KooiInc on


Description

check if --i>=0 is faster then i--

Preparation HTML

<script>
  var arr = (function() {
   var i = 0,
       ret = [];
   while (i++ < 100000) {
    ret[i] = i;
   }
   return ret;
  })();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
i--
var i = arr.length,
    j;
while (i--) {
 j = i;
}
ready
--i>=0
var i = arr.length,
    j;
while (--i >= 0) {
 j = 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 KooiInc on