Object.assign vs spread operator vs _.extendFastest: spread operator (3.3x faster)
17,813,026 ops/sec
8,537,477 ops/sec
5,322,698 ops/sec
Fastest: Object.assign (1.4x faster)
17,026,004 ops/sec
15,107,530 ops/sec
11,767,460 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Object.assign | |
| spread operator | |
| _.extend |
| Test name | Executions per second |
|---|---|
| ✓ Object.assign | 7,095,324 Ops/sec |
| _.extend | 6,147,134 Ops/sec |
| spread operator | 5,764,463 Ops/sec |