Skip to content

Engineering / Open resources

Cloning JSON data

JSON.parse/stringify and structuredClone on synthetic data: reproducible script, samples and execution context.

Download json-clone.csv

Method

The script generates lists of 100, 1,000 and 5,000 JSON events, warms each function 20 times and measures 30 batches of 10 copies. Method order alternates per sample. The table shows median milliseconds per copy; the CSV retains all samples.

Limits and reproduction

A local measurement on one machine; GC and concurrent load affect timing. The dataset contains only JSON values: it does not test Date, Map, cycles or transferables. The methods are not equivalent for every object. Download the script and run node benchmark-json.mjs ./result to produce your own CSV and JSON.

Results of this run

Node v24.22.0 · linux/x64 · Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz

Milliseconds per copy
EventsMethodMedian (ms)Min / Max (ms)
100JSON.parse/stringify0.15030.1198 / 0.201
100structuredClone0.22070.1817 / 0.3619
1,000JSON.parse/stringify1.3961.3116 / 1.8692
1,000structuredClone2.20672.1073 / 3.5019
5,000JSON.parse/stringify8.13657.4225 / 9.8811
5,000structuredClone12.650211.998 / 15.3835
Technical reference