Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
unshift() vs push() vs allocate-fill()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.6.2
Device Platform:
Mobile
Date tested:
8 months ago
Test name
Executions per second
unshift
1.0 Ops/sec
push
3879.4 Ops/sec
allocate-fill
18242.3 Ops/sec
Tests:
unshift
let a = []; for(var i = 0; i < 100000; ++i) { a.unshift(i); }
push
let a = []; for(var i = 0; i < 100000; ++i) { a.push(i); }
allocate-fill
var array = Array(100000); for(var i = 0; i < array.length; ++i) { array[i] = i; }