Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Linux
Desktop
one year ago
Benchmark.js
Reduce (reusing object)
8K/s
Object.fromEntries with Array.map
1K/s
new Map with Array.map
1K/s
Reduce (creating temporary objects)
49/s
View exact numbers
Test name Executions per second
Reduce (reusing object) 7,522 Ops/sec
Object.fromEntries with Array.map 1,376 Ops/sec
new Map with Array.map 1,236 Ops/sec
Reduce (creating temporary objects) 49 Ops/sec
Script Preparation code:
Tests: