Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135
Linux
Desktop
one year ago
Benchmark.js
keyBy with for loop
24.4M/s
keyBy with native reduce
21.7M/s
keyBy with forEach
16.2M/s
View exact numbers
| Test name |
Executions per second |
|
✓
keyBy with for loop
|
24,364,228 Ops/sec |
|
keyBy with native reduce
|
21,696,056 Ops/sec |
|
lodash/keyBy
|
21,427,928 Ops/sec |
|
keyBy with forEach
|
16,209,115 Ops/sec |
Tests:
-
lodash/keyBy
-
keyBy with native reduce
-
keyBy with forEach
-
keyBy with for loop