Run details:
Mozilla/5.0 (iPad; CPU OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/96.0.4664.53 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 96
iOS 14.8
Tablet
3 years ago
Test name Executions per second
Using the spread operator 5982192.5 Ops/sec
Using Object.assign 3510799.0 Ops/sec
Manually copying properties 93114744.0 Ops/sec
Create new object while copying 94445120.0 Ops/sec
Create new object from scratch 305625248.0 Ops/sec
JSON 624317.0 Ops/sec
Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch

  • JSON