Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Chrome 120
Windows
Desktop
2 years ago
Benchmark.js
Reduce (reuse object)
16K/s
For-of
15K/s
Object.fromEntries
8K/s
Reduce (creating temporary objects)
1K/s
View exact numbers
Test name Executions per second
Reduce (reuse object) 15,837 Ops/sec
For-of 15,048 Ops/sec
Object.fromEntries 7,586 Ops/sec
Reduce (creating temporary objects) 1,240 Ops/sec
Script Preparation code:
Tests: