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/144.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 144
Operating system:
Android
Device Platform:
Mobile
Date tested:
9 months ago
Benchmark engine:
Benchmark.js
Preallocate
17K/s
Push
14K/s
View exact numbers
Test name
Executions per second
✓
Preallocate
16,959 Ops/sec
Push
14,199 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}); }