Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Windows
Desktop
2 years ago
Benchmark.js
Reduce (reusing object)
12K/s
Object.fromEntries with Array.map
2K/s
new Map with Array.map
1K/s
Reduce (creating temporary objects)
58/s
View exact numbers
Test name Executions per second
Reduce (reusing object) 12,201 Ops/sec
Object.fromEntries with Array.map 2,140 Ops/sec
new Map with Array.map 1,481 Ops/sec
Reduce (creating temporary objects) 58 Ops/sec
Script Preparation code:
Tests: