Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
2 getItems(): flatMap() vs map() and flat()
(version: 1)
getItems() behavior from Mikro ORM: flatMap vs map and flat
Comparing performance of:
map().flat() vs flatMap()
Created:
one month ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = new Set(); var i = 0; while (i <= 500) arr.add({ num: [1, i++] });
Tests:
map().flat()
[...arr].map(x => x.num % 5 === 0 ? [] : x.num).flat()
flatMap()
[...arr].flatMap(x => (x => x.num % 5 === 0 ? [] : x.num))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
map().flat()
flatMap()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0
Browser/OS:
Firefox 150 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
map().flat()
4265.1 Ops/sec
flatMap()
54338.3 Ops/sec
Related benchmarks:
flatMap() vs map().flat()
flatMap() vs map() and flat()
flatmap vs flat and map
.flatMap() vs .map().flat()
flatMap vs mapFlat
flatMap() vs flat().map()
flatMap() vs map(...).flat()
.flatMap() vs .map()
getItems(): flatMap() vs map() and flat()
Comments
Confirm delete:
Do you really want to delete benchmark?