Using the spread operator vs Using Object.assign vs Not mergingFastest: Using the spread operator (5.3x faster)
35,875,352 ops/sec
12,840,629 ops/sec
6,709,864 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 | |
| Not merging |
| Test name | Executions per second |
|---|---|
| ✓ Not merging | 13,097,471 Ops/sec |
| Using Object.assign | 12,372,391 Ops/sec |
| Using the spread operator | 9,493,565 Ops/sec |