Using the spread operator vs Using Object.assign vs Manual copyFastest: Manual copy (11.3x faster)
94,312,768 ops/sec
18,482,314 ops/sec
8,343,180 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Using the spread operator | |
| Using Object.assign | |
| Manual copy |
| Test name | Executions per second |
|---|---|
| ✓ Manual copy | 781,814,912 Ops/sec |
| Using Object.assign | 7,186,858 Ops/sec |
| Using the spread operator | 3,283,393 Ops/sec |