Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.push + Array.reverse vs Array.unshift
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/136.2 Mobile/15E148 Safari/605.1.15
Browser:
Mobile Safari 18
Operating system:
iOS 18.3.2
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Array.push + Array.reverse
26669.9 Ops/sec
Array.unshift
97.0 Ops/sec
Script Preparation code:
const array = Array.from({length: 10_000}, () => Math.floor(Math.random() * 10_000_000))
Tests:
Array.push + Array.reverse
const temp = []; array.forEach(x => temp.push(x)); return temp.reverse();
Array.unshift
const temp = []; array.forEach(x => temp.unshift(x)); return temp;