Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array initialization: preallocate vs push with objects
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 141
Operating system:
Android
Device Platform:
Mobile
Date tested:
11 months ago
Benchmark engine:
Benchmark.js
Preallocate
17K/s
Push
11K/s
View exact numbers
Test name
Executions per second
✓
Preallocate
17,228 Ops/sec
Push
10,674 Ops/sec
Tests:
Preallocate
var N = 10000; var result = new Array(N); for (var i = 0; i < N; i++) { result[i] = {n: N}; }
Push
var N = 10000; var result = []; for (var i = 0; i < N; i++) { result.push({n: N}); }