Gains according to pyperformance:
```
deepcopy:
Mean +- std dev: 411 us +- 2 us -> 396 us +- 3 us: 1.04x faster
Significant (t=28.94)
deepcopy_reduce:
Mean +- std dev: 4.38 us +- 0.05 us -> 4.23 us +- 0.04 us: 1.04x faster
Significant (t=20.05)
```
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
*, deepcopy=deepcopy):
deep = memo is not None
if deep and args:
- args = (deepcopy(arg, memo) for arg in args)
+ args = [deepcopy(arg, memo) for arg in args]
y = func(*args)
if deep:
memo[id(x)] = y
Bennett Todd
R Lindsay Todd
Eugene Toder
+Heikki Toivonen
Erik Tollerud
Stephen Tonkin
Matias Torchinsky
--- /dev/null
+Speed up :func:`copy.deepcopy` by 1.04x.