`JSON.stringify` is ~2.4× faster than `JSON.parse`
For the same megabyte, parsing costs more than serialising. Parsing has to tokenise and build objects.
Result
| Run | `JSON.parse` (1 MB) | `JSON.stringify` (same object) | Ratio |
|---|---|---|---|
| Run 1 | 3.284 | 1.167 | 2.81× |
| Run 2 | 2.850 | 1.186 | 2.40× |
| Run 3 | 2.868 | 1.212 | 2.37× |
Conditions
Parsing a 1 MB JSON string versus stringifying an object of the same size.
Where this number does not apply
The ratio moves with shape — deep nesting, numeric density, string length. We measured one structure only.
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.