Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from vs Array.fill vs [...Array].map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 26
Operating system:
iOS 18.6
Device Platform:
Mobile
Date tested:
9 months ago
Test name
Executions per second
from
551.0 Ops/sec
fill
689.7 Ops/sec
spread
213.1 Ops/sec
Tests:
from
let n = 10000, length = 50 const result = [] for (let i = 0; i < n; ++i) { result.push(Array.from({length:length}).map((_, i) => i + 1)) }
fill
let n = 10000, length = 50 const result = [] for (let i = 0; i < n; ++i) { result.push(Array(length).fill(0).map((_,i) => i + 1)) }
spread
let n = 10000, length = 50 const result = [] for (let i = 0; i < n; ++i) { result.push([...Array(length)].map((_,i) => i + 1)) }