Run details:
Mozilla/5.0 (X11; CrOS x86_64 14816.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Chrome OS 14816.64.0
Desktop
one year ago
Test name Executions per second
Using the spread operator 5633839.0 Ops/sec
Using Object.assign 665179.7 Ops/sec
Manually copying properties 262858528.0 Ops/sec
Create new object while copying 268289200.0 Ops/sec
Create new object from scratch 463780288.0 Ops/sec
Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch