Loops (v280)

Revision 280 of this benchmark created on


Preparation HTML

<script>
  var arr10 = new Array(10);
var arr100 = new Array(100);
var arr1000 = new Array(1000);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
reversed for loop on array(100)
const l = arr100.length
for (var i = arr100.length - 1; i>=0; --i){

}
ready
standard for loop on array(100)
for (var i = 0; i<arr100.length; ++i){

}
ready
reversed for loop on array(100) with length cached
const l = arr100.length
for (var i = l - 1; i>=0; --i){

}
ready
length cached for loop on array(1000)
const l = arr100.length
for (var i = 0; i<l; ++i){

}
ready

Revisions

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