`structuredClone` is ~2.4× slower than a JSON round-trip
A JSON round-trip is faster for deep copies — but it destroys Date, Map, undefined, and cyclic references. Do not pick it on speed alone.
Result
| Run | `structuredClone` | `JSON.parse(JSON.stringify())` | Ratio |
|---|---|---|---|
| Run 1 | 9.697 | 3.560 | 2.72× |
| Run 2 | 9.362 | 3.851 | 2.43× |
| Run 3 | 8.586 | 3.949 | 2.17× |
Conditions
Deep-copying a ~1 MB, 4,000-record object (the JSON path re-parses the same string).
Where this number does not apply
We measured speed only, not memory. The JSON path allocates a large temporary string, which can hurt on big payloads.
Reproduce
cd bench
node --expose-gc micro-fixed.mjs --out ../data/run.json --samples 21 Run it three times on the same machine; if the spread of median stays under 10%, you should land on the same conclusion. If your numbers disagree, tell us and we will retract.