Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from vs map vs Array.from then map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.3
Device Platform:
Mobile
Date tested:
one year ago
Loop
718K/s
Array.from
353K/s
Loop push
223K/s
Array.from and Map
189K/s
Map
44K/s
View exact numbers
Test name
Executions per second
✓
Loop
718,241 Ops/sec
Array.from
353,202 Ops/sec
Loop push
222,876 Ops/sec
Array.from and Map
188,969 Ops/sec
Map
44,317 Ops/sec
Tests:
Array.from
Array.from({ length: 1000 }, i => i)
Map
new Array(1000).map(i => i);
Loop
const arr = new Array(1000); for (let i = 0; i < 1000; i++) arr[i] = i
Loop push
const arr = [] for (let i = 0; i < 1000; i++) arr.push(i)
Array.from and Map
Array.from({ length: 1000 }).map(i => i);