reduce vs map + fromEntries vs reduce spread

6 months ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Test name Executions per second
reduce 3255.5 Ops/sec
map + fromEntries 1570.9 Ops/sec
reduce spread 126.5 Ops/sec
Script Preparation code:
Tests:
  • reduce

  • map + fromEntries

  • reduce spread

Open this result on MeasureThat.net