Pyベンチ実測MEASURED, NOT RECALLED

    ↑↓ to select, Enter to open, Esc to close

    deepcopy is ~1.62× slower than JSON ラウンドトリップ

    A JSON round-trip copies this structure ~1.6× faster than `deepcopy`.

    Result

    RunJSON ラウンドトリップdeepcopyRatio
    Run 1152.371245.9900.62×
    Run 2153.013247.0560.62×
    Run 3147.808243.1780.61×

    Spread over 3 runs: JSON ラウンドトリップ CV 1.5% / deepcopy CV 0.7% / Ratio CV 0.9%

    152.37 ms245.99 msRun1153.01 ms247.06 msRun2147.81 ms243.18 msRun3JSON ラウンドトリップ (#b9c6d2) / deepcopy (#2f6f4f)

    Conditions

    A structure with a 200-item list and a 100-key dict, copied 2,000 times.

    Where this number does not apply

    Types that do not survive JSON (datetime, set, custom classes) make this unusable — the round-trip changes types.

    Reproduce

    cd bench && python micro_py.py --out ../data/run.json --samples 21