Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Does presetting the size of an array make a difference?
(version: 0)
Comparing performance of:
Dynamic vs Preset
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var size = 10000;
Tests:
Dynamic
const arr = []; for (let i = 0; i < size; i++) { arr[i] = i; }
Preset
const arr = new Array(size); for (let i = 0; i < size; i++) { arr[i] = i; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Dynamic
Preset
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:
Clear array via array = [] vs array.length = 0
array[0] vs array.at(0)
array[0] vs array.at(0) on 100000 elements
Empty an array in JavaScript
Empty an array in JavaScript (with baseline)
Comments
Confirm delete:
Do you really want to delete benchmark?