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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 132
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
fill twice
2K/s
from with mapper
43/s
View exact numbers
Test name
Executions per second
✓
fill twice
1,710 Ops/sec
from with mapper
43 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)); }