Script Preparation code:
Tests:

Historical Performance Data aggregated from 7 community runs

Desktop Results:
Chrome 7 runs
Reduce (reusing object)
8K/s
Object.fromEntries with Array.map
2K/s
new Map with Array.map
1K/s
Reduce (creating temporary objects)
60/s

Fastest: Reduce (reusing object) (130.3x faster)

View exact numbers
  • Reduce (reusing object): 7,777 ops/sec
  • Object.fromEntries with Array.map: 1,825 ops/sec
  • new Map with Array.map: 1,244 ops/sec
  • Reduce (creating temporary objects): 60 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
    Object.fromEntries with Array.map
    new Map with Array.map
    Reduce (reusing object)
    Reduce (creating temporary objects)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Firefox 139 on Windows
View result in a separate tab
Reduce (reusing object)
7K/s
Object.fromEntries with Array.map
4K/s
new Map with Array.map
1K/s
Reduce (creating temporary objects)
0/s
View exact numbers
Test name Executions per second
Reduce (reusing object) 7,057 Ops/sec
Object.fromEntries with Array.map 3,651 Ops/sec
new Map with Array.map 1,373 Ops/sec
Reduce (creating temporary objects) 0 Ops/sec