Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
flatmap vs reduce for building arrays
(version: 1)
Comparing performance of:
flatMap vs reduce
Created:
one month ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var array = Array(10_000).fill({ id: 1 })
Tests:
flatMap
array.flatMap(({id})=>[id])
reduce
array.reduce((acc, {a})=>[...acc,a],[])
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
flatMap
reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Browser/OS:
Chrome 149 on Ubuntu
View result in a separate tab
Embed
Embed Benchmark Result
flatMap
3K/s
reduce
8/s
View exact numbers
Test name
Executions per second
✓
flatMap
3,356 Ops/sec
reduce
8 Ops/sec
Related benchmarks
flatMap vs reduce
flatMap vs reduce flattern array
Comments
Confirm delete:
Do you really want to delete benchmark?