Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36
Chrome 102
Windows 7
Desktop
2 years ago
Test name Executions per second
Iteration with blank object 696622.5 Ops/sec
Object.assign with blank object 2031071.5 Ops/sec
Iteration with created object 528775.8 Ops/sec
Object.assign with created object 1114780.0 Ops/sec
Iteration with blank object and prototype 512254.5 Ops/sec
Object.assign with blank object and prototype 1032359.0 Ops/sec
Iteration with blank object and prototype prop 614118.5 Ops/sec
Object.assign with blank object and prototype prop 1549525.0 Ops/sec
Script Preparation code:
Tests:
  • Iteration with blank object

  • Object.assign with blank object

  • Iteration with created object

  • Object.assign with created object

  • Iteration with blank object and prototype

  • Object.assign with blank object and prototype

  • Iteration with blank object and prototype prop

  • Object.assign with blank object and prototype prop