Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
Chrome 93
Mac OS X 10.13.6
Desktop
3 years ago
Test name Executions per second
Reduce / Spread 343.1 Ops/sec
Map Object.entries / Object.fromEntries 4919.0 Ops/sec
Object.assign - single spread, no mutation 15033.9 Ops/sec
Object.assign - single spread, mutate first 24551.4 Ops/sec
Simple fromEntries 13556.4 Ops/sec
Script Preparation code:
Tests:
  • Reduce / Spread

  • Map Object.entries / Object.fromEntries

  • Object.assign - single spread, no mutation

  • Object.assign - single spread, mutate first

  • Simple fromEntries


;