Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from with mapper vs Array.fill
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
from with mapper
71.6 Ops/sec
fill twice
2763.2 Ops/sec
Tests:
from with mapper
let n = 10000, length = 50 const result = [] const lengthObj = {length:length} const mapper = (_, i) => i < 25 ? 0 : 1 for (let i = 0; i < n; ++i) { result.push(Array.from(lengthObj, mapper)); }
fill twice
let n = 10000, length = 50 const result = [] for (let i = 0; i < n; ++i) { result.push(Array(5).fill(0, 0, 25).fill(1, 25)); }