Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116
Linux
Desktop
one year ago
Test name Executions per second
Using the spread operator 47310940.0 Ops/sec
Using Object.assign 5096243.0 Ops/sec
Manually copying properties 716252480.0 Ops/sec
Create new object while copying 720067840.0 Ops/sec
Create new object from scratch 736776384.0 Ops/sec
Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch