Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
Chrome 95
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
Iteration with blank object 830858.0 Ops/sec
Object.assign with blank object 2314006.2 Ops/sec
Iteration with created object 649707.8 Ops/sec
Object.assign with created object 1333741.0 Ops/sec
Iteration with blank object and prototype 629457.6 Ops/sec
Object.assign with blank object and prototype 1224387.0 Ops/sec
Iteration with blank object and prototype prop 758475.1 Ops/sec
Object.assign with blank object and prototype prop 1790945.5 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