JSON.stringify vs structuredClone vs spread vs Object.assignFastest: spread (25.4x faster)
7,023,620 ops/sec
6,366,092 ops/sec
996,418 ops/sec
276,569 ops/sec
Fastest: Object.assign (39.3x faster)
37,221,480 ops/sec
15,812,526 ops/sec
1,061,596 ops/sec
947,336 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| JSON.stringify | |
| structuredClone | |
| spread | |
| Object.assign |
| Test name | Executions per second |
|---|---|
| ✓ Object.assign | 34,809,060 Ops/sec |
| spread | 13,646,557 Ops/sec |
| JSON.stringify | 1,018,194 Ops/sec |
| structuredClone | 946,017 Ops/sec |