HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 16 community runs

Desktop Results:
Chrome 16 runs
map
12.5M/s
keyBy with for loop
8.6M/s
keyBy with native reduce
8.3M/s
lodash/keyBy
6.4M/s
keyBy with forEach
4.8M/s

Fastest: map (2.6x faster)

View exact numbers
  • map: 12,491,581 ops/sec
  • keyBy with for loop: 8,610,459 ops/sec
  • keyBy with native reduce: 8,338,228 ops/sec
  • lodash/keyBy: 6,410,988 ops/sec
  • keyBy with forEach: 4,782,687 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    lodash/keyBy
    keyBy with native reduce
    keyBy with forEach
    keyBy with for loop
    map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Chrome 147 on Mac OS X 10.15.7
View result in a separate tab
map
76.7M/s
keyBy with for loop
29.6M/s
keyBy with native reduce
26.6M/s
lodash/keyBy
25.6M/s
keyBy with forEach
12.9M/s
View exact numbers
Test name Executions per second
map 76,674,888 Ops/sec
keyBy with for loop 29,593,452 Ops/sec
keyBy with native reduce 26,622,266 Ops/sec
lodash/keyBy 25,613,462 Ops/sec
keyBy with forEach 12,874,543 Ops/sec