Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
flatMap vs flat+map
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/133.0.0.0 Mobile Safari/537.36 EdgA/133.0.0.0
Browser:
Chrome Mobile 133
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
flatmap
3K/s
map+flat
1K/s
View exact numbers
Test name
Executions per second
✓
flatmap
3,052 Ops/sec
map+flat
1,410 Ops/sec
Script Preparation code:
var arr = Array(10_000).fill(0)
Tests:
flatmap
arr.flatMap((x) => [x, x])
map+flat
arr.map((x) => [x, x]).flat()