Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133
Linux
Desktop
one year ago
Benchmark.js
forEach
1K/s
Reduce (reuse object)
1K/s
Map
395/s
Object.fromEntries
149/s
Object.assign
82/s
Reduce (creating temporary objects)
0/s
View exact numbers
Test name Executions per second
forEach 1,327 Ops/sec
Reduce (reuse object) 1,074 Ops/sec
Map 395 Ops/sec
Object.fromEntries 149 Ops/sec
Object.assign 82 Ops/sec
Reduce (creating temporary objects) 0 Ops/sec
Script Preparation code:
Tests: