Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from vs map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 125
Operating system:
iOS 17.5
Device Platform:
Mobile
Date tested:
2 years ago
Loop push
37.5M/s
Loop
13.6M/s
Array.from
10.0M/s
Map
3.5M/s
View exact numbers
Test name
Executions per second
✓
Loop push
37,545,376 Ops/sec
Loop
13,558,185 Ops/sec
Array.from
9,988,345 Ops/sec
Map
3,530,711 Ops/sec
Tests:
Array.from
Array.from({ length: 10 }, i => i)
Map
new Array(10).map(i => i);
Loop
const arr = new Array(10); for (let i = 0; i < 10; i++) arr[i] = i
Loop push
const arr = [] for (let i = 0; i < 10; i++) arr.push(i)