Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array initialization: preallocate a typed array vs vanilla preallocation
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Browser:
Chrome 149
Operating system:
Windows
Device Platform:
Desktop
Date tested:
15 days ago
Preallocate vanilla
85K/s
Preallocate typed
83K/s
View exact numbers
Test name
Executions per second
✓
Preallocate vanilla
84,844 Ops/sec
Preallocate typed
83,341 Ops/sec
Tests:
Preallocate typed
var N = 10000; var result = new Uint8Array(N); for (var i = 0; i < N; i++) { result[i] = i; }
Preallocate vanilla
var N = 10000; var result = new Array(N); for (var i = 0; i < N; i++) { result[i] = i; }