Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Chrome 64
Mac OS X 10.12.6
Other
2025 years ago
Test name Executions per second
Object.assign two objects 15837.4 Ops/sec
Spread two objects 13489.0 Ops/sec
Object.assign three objects 9236.0 Ops/sec
Spread three objects 10015.1 Ops/sec
Object.assign four objects 6416.9 Ops/sec
Spread four objects 6915.5 Ops/sec
Object.assign five objects 5272.9 Ops/sec
Spread five objects 5900.4 Ops/sec
Object.assign six objects 4620.1 Ops/sec
Spread six objects 4973.5 Ops/sec
Script Preparation code:
Tests:
  • Object.assign two objects

  • Spread two objects

  • Object.assign three objects

  • Spread three objects

  • Object.assign four objects

  • Spread four objects

  • Object.assign five objects

  • Spread five objects

  • Object.assign six objects

  • Spread six objects