Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Windows
Desktop
7 months ago
Test name Executions per second
Object.fromEntries 1103.1 Ops/sec
Reduce (reuse object) 1892.0 Ops/sec
Reduce (creating temporary objects) 39.9 Ops/sec
Reduce (Object to Map) 1222.7 Ops/sec
Reduce (Object to Set) 1296.3 Ops/sec
Init (Object to Map) 1270.9 Ops/sec
Init (Object to Set) 1326.6 Ops/sec
Script Preparation code:
Tests:
  • Object.fromEntries

  • Reduce (reuse object)

  • Reduce (array to Map)

  • Reduce (array to Set)

  • Init (Object to Map)

  • Init Set (from array using `Object.values`)

  • Init Set (from array)

  • From Object to Map to Object


;