Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
array fill vs spread
(version: 1)
Array fill method vs for loop performance validation
Comparing performance of:
For Loop fill vs Array Fill
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
For Loop fill
let arrayTest = [...new Array(10000000)].map(() => null);
Array Fill
let arrayTest = new Array(10000000).fill('').map(() => null);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
For Loop fill
Array Fill
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser/OS:
Firefox 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
For Loop fill
2.9 Ops/sec
Array Fill
3.4 Ops/sec
Related benchmarks:
Array fill method vs for loop
Array fill method vs for loop_
Array fill method vs for loop__
Array fill method vs for loop_q
Array fill method vs for loop small array
Array fill method vs push in for loop
Array fill method vs for loop vs map
Array fill method vs for loop vs push
Array fill method vs for loop test
Comments
Confirm delete:
Do you really want to delete benchmark?