Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Ubuntu
Desktop
2 years ago
Test name Executions per second
Using the spread operator 4568377.5 Ops/sec
Using Object.assign 4198102.0 Ops/sec
Manually copying properties 25743122.0 Ops/sec
Create new object while copying 233508384.0 Ops/sec
Create new object from scratch 253797152.0 Ops/sec
JSON 554665.6 Ops/sec
Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch

  • JSON