JSベンチ実測MEASURED, NOT RECALLED

    ↑↓ で選択、Enter で開く。Esc で閉じる。

    Home / Findings

    `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 13.2841.1672.81×
    Run 22.8501.1862.40×
    Run 32.8681.2122.37×

    Median spread: `JSON.parse` (1 MB) CV 6.7% / `JSON.stringify` (same object) CV 1.5% / Ratio CV 8.0% (computed from the 3 runs)

    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.