Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Chrome 92
Linux
Desktop
3 years ago
Test name Executions per second
lodash/keyBy 2186929.0 Ops/sec
keyBy with native reduce 3130355.5 Ops/sec
keyBy with forEach 1750909.1 Ops/sec
keyBy with for loop 3283206.2 Ops/sec
keyByReduce 635388.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • lodash/keyBy

  • keyBy with native reduce

  • keyBy with forEach

  • keyBy with for loop

  • keyByReduce