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
Test name
Executions per second
Array.from
353201.8 Ops/sec
Map
44316.6 Ops/sec
Loop
718241.4 Ops/sec
Loop push
222875.8 Ops/sec
Array.from and Map
188969.1 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);