basic iteration simple loop with condition vs dummy array with length vs reduced iteration using duplication in for body (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
array for in
var a = 5; 
for(var b in Array(64).fill()) { a = 10 }
ready
for count
var a = 5; 
for(var b =0; b < 64; b++) { a = 10 }
ready
for count half
var a = 5; 
for(var b =0; b < 32; b++) { a = 10; a = 10 }
ready
array with length
var a = 5; 
var arr = Array(64).fill()
for(var b =0; b < arr.length ; b++) { a = 10 }
ready
for count 1/4
var a = 5; 
for(var b =0; b < 16; b++) { a = 10; a = 10; a = 10; a = 10 }
ready

Revisions

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