deepcopy is ~37.04× slower than copy(浅い)
Even for a nested dict, `copy()` (shallow) is ~37× faster than `deepcopy()`.
Result
| Run | copy(浅い) | deepcopy | Ratio |
|---|---|---|---|
| Run 1 | 17.365 | 654.667 | 0.03× |
| Run 2 | 17.536 | 669.348 | 0.03× |
| Run 3 | 17.685 | 659.718 | 0.03× |
Spread over 3 runs: copy(浅い) CV 0.7% / deepcopy CV 0.9% / Ratio CV 0.9%
Conditions
A two-level dict copied 100,000 times.
Where this number does not apply
A shallow copy shares nested objects — that is exactly why it is fast, and why edits leak.
Reproduce
cd bench && python micro_py.py --out ../data/run.json --samples 21