Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Linux
Desktop
2 years ago
Benchmark.js
keyBy with for loop
20.9M/s
keyBy with native reduce
15.7M/s
keyBy with forEach
11.8M/s
View exact numbers
| Test name |
Executions per second |
|
✓
keyBy with for loop
|
20,880,724 Ops/sec |
|
keyBy with native reduce
|
15,663,119 Ops/sec |
|
lodash/keyBy
|
12,684,586 Ops/sec |
|
keyBy with forEach
|
11,843,843 Ops/sec |
Tests:
-
lodash/keyBy
-
keyBy with native reduce
-
keyBy with forEach
-
keyBy with for loop