json.stringify + TextEncode vs structuredClone vs json.stringify vs JSONFastest: json.stringify (3.4x faster)
101,094 ops/sec
47,100 ops/sec
35,763 ops/sec
29,478 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 + TextEncode | |
| structuredClone | |
| json.stringify | |
| JSON |
| Test name | Executions per second |
|---|---|
| ✓ json.stringify | 78,653 Ops/sec |
| json.stringify + TextEncode | 54,837 Ops/sec |
| JSON | 25,627 Ops/sec |
| structuredClone | 20,223 Ops/sec |