Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Firefox 139
Windows
Desktop
one year ago
Benchmark.js
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
Script Preparation code:
Tests: