Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Using the spread operator
    Using Object.assign
    Manually copying properties
    Create new object while copying
    Create new object from scratch

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128 on Linux
View result in a separate tab
Test name Executions per second
Using the spread operator 8546423.0 Ops/sec
Using Object.assign 18443850.0 Ops/sec
Manually copying properties 51300900.0 Ops/sec
Create new object while copying 258482400.0 Ops/sec
Create new object from scratch 250854200.0 Ops/sec