Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
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:
4 months ago
by:
Guest
Go to the latest result
Script Preparation code:
var arr = []; var i = 0; while (i <= 1E5) arr[i] = { num: [1, i++] };
Tests:
map().flat()
[...arr].map(x => x.num).flat()
flatMap()
[...arr].flatMap(x => 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:
4 months 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
flatMap()
190/s
map().flat()
185/s
View exact numbers
Test name
Executions per second
✓
flatMap()
190 Ops/sec
map().flat()
185 Ops/sec
Related benchmarks
flatMap() vs map().flat()
flatMap() vs map() and flat()
flatMap() vs flat().map()
2 getItems(): flatMap() vs map() and flat()
Comments
Confirm delete:
Do you really want to delete benchmark?