Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Mac OS X 10.15
Desktop
2 years ago
Benchmark.js
Reduce (reuse object)
2K/s
Custom implementation
2K/s
Map
926/s
Object.fromEntries
379/s
Reduce (creating temporary objects)
0/s
View exact numbers
Test name Executions per second
Reduce (reuse object) 2,161 Ops/sec
Custom implementation 2,113 Ops/sec
Map 926 Ops/sec
Object.fromEntries 379 Ops/sec
Reduce (creating temporary objects) 0 Ops/sec
Script Preparation code:
Tests: