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
Test name
Executions per second
Array.from
11.7 Ops/sec
Spread
29.2 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);