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
Go 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
Array Fill
3/s
For Loop fill
3/s
View exact numbers
Test name
Executions per second
✓
Array Fill
3 Ops/sec
For Loop fill
3 Ops/sec
Related benchmarks
Array fill method vs for loop
Array fill method vs for loop__
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?