Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
loop length recalculation
(version: 0)
Comparing performance of:
normal loop vs loop without length vs reverse loop vs weird trick
Created:
8 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr=new Array(1000000).fill(0)
Tests:
normal loop
for (var i=0;i<arr.length;i++){val=arr[i]}
loop without length
var l=arr.length; for (var i=0;i<l;i++){val=arr[i]}
reverse loop
for (var i=arr.length;i>0;i--){val=arr[i]}
weird trick
for (var i=arr.length;i>0;i--){val=arr[i]|0}
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
normal loop
loop without length
reverse loop
weird trick
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
loop length recalculation
loop length recalculation
loop length recalculation
TypedArray fill vs loop
Comments
Confirm delete:
Do you really want to delete benchmark?