Tests:
-
lodash/keyBy
-
keyBy with native reduce
-
keyBy with forEach
-
keyBy with for loop
-
Native Object.groupBy
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
keyBy with for loop
17.7M/s
keyBy with native reduce
15.9M/s
keyBy with forEach
11.4M/s
Native Object.groupBy
2.7M/s
View exact numbers
| Test name |
Executions per second |
|
✓
keyBy with for loop
|
17,744,144 Ops/sec |
|
keyBy with native reduce
|
15,941,888 Ops/sec |
|
lodash/keyBy
|
15,594,077 Ops/sec |
|
keyBy with forEach
|
11,389,180 Ops/sec |
|
Native Object.groupBy
|
2,666,574 Ops/sec |
Do you really want to delete benchmark?