Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array(1,000,000 length) Mapping | Array.from vs Spread
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 131
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Spread
29/s
Array.from
12/s
View exact numbers
Test name
Executions per second
✓
Spread
29 Ops/sec
Array.from
12 Ops/sec
Script Preparation code:
const largeArray = []; for (let i = 0; i < 1_000_000; i++) { largeArray.push(i); }
Tests:
Array.from
const arrFromMapped = Array.from(largeArray, x => x * 2);
Spread
const arrSpreadMapped = [...largeArray].map(x => x * 2);