Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Roman_Var_In_Loop
(version: 1)
to var or not to var in loop
Comparing performance of:
1 vs 2
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
1
let foo = 0; for(let i = 0; i < 100; ++i) { let newFoo = 1; foo = newFoo +foo; } console.log(foo);
2
let foo = 0; for(let i = 0; i < 100; ++i) { foo += 1; } console.log(foo);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
1
280429.1 Ops/sec
2
271639.4 Ops/sec
Related benchmarks:
Test for vs foreach vs forof
name123123
for [i,j] big/small -_-
for [i,j] big/small ;
Inlining
Math.log10() vs .toString()
test for loop - 123122
stringbuilder
For Difference
Comments
Confirm delete:
Do you really want to delete benchmark?