LoopPerf

Benchmark created by Srikanth Rayabhagi on


Preparation HTML

<script>
  var arr = new Array();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Traditional Slow Loop
for (var i = 0; i < arr.length; i++) {
  console.log('1:' + arr[i]);
}
ready
The fast one
for (var i = 0, ii = arr.length; i < ii; i++) {
  console.log('2:' + arr[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 Srikanth Rayabhagi on