Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch

  • StructuredClone

  • JSON

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
    StructuredClone
    JSON

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36 OPR/95.0.0.0
Opera Mobile 95 on Android
View result in a separate tab
Test name Executions per second
Using the spread operator 40543332.0 Ops/sec
Using Object.assign 10563756.0 Ops/sec
Manually copying properties 119866712.0 Ops/sec
Create new object while copying 119516416.0 Ops/sec
Create new object from scratch 127190776.0 Ops/sec
StructuredClone 331637.3 Ops/sec
JSON 2229923.5 Ops/sec