Object.defineProperty vs Object spread vs Object.assign (mutable)Fastest: Object.defineProperty (5.3x faster)
41,305 ops/sec
40,634 ops/sec
7,841 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Object.defineProperty | |
| Object spread | |
| Object.assign (mutable) |
| Test name | Executions per second |
|---|---|
| ✓ Object.defineProperty | 33,152 Ops/sec |
| Object.assign (mutable) | 31,284 Ops/sec |
| Object spread | 8,546 Ops/sec |