Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
flatMap vs reduce Saran
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/146.0.7680.151 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 146
Operating system:
iOS 18.6.2
Device Platform:
Mobile
Date tested:
one month ago
Test name
Executions per second
reduce with array push
19609.3 Ops/sec
flatMap
11918.8 Ops/sec
Script Preparation code:
var arr = Array(10_000).fill(0)
Tests:
reduce with array push
arr.reduce((acc, x) => { acc.push(x); acc.push(x); return acc; }, [])
flatMap
arr.flatMap(x => [x, x])