Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array initialization: preallocate a typed array vs vanilla and push
(version: 1)
Comparing performance of:
Preallocate vs Push
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
Preallocate
var N = 10000; var result = new Uint8Array(N); for (var i = 0; i < N; i++) { result[i] = i; }
Push
var N = 10000; var result = []; for (var i = 0; i < N; i++) { result.push(i); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Preallocate
Push
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!
Comments
Confirm delete:
Do you really want to delete benchmark?