Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Linux
Desktop
2 years ago
Benchmark.js
Reduce (reusing object)
8K/s
Object.fromEntries with Array.map
2K/s
new Map with Array.map
1K/s
Reduce (creating temporary objects)
57/s
View exact numbers
Test name Executions per second
Reduce (reusing object) 8,147 Ops/sec
Object.fromEntries with Array.map 1,825 Ops/sec
new Map with Array.map 1,244 Ops/sec
Reduce (creating temporary objects) 57 Ops/sec
Script Preparation code:
Tests: