Commit 6a7529d
committed
Switch deepcopy memo check to
pochmann benchmarked this issue's candidate fixes on gh-154594 and found
the try/except form is ~3.5x slower on a memo miss (the common case in
real deepcopy workloads) despite being fastest on a hit. `d in memo` ties
or beats the current `is not None` check on both hit and miss, and
matches where the competing PR (gh-154595) landed after the same
discussion.d in memo
1 parent 3660617 commit 6a7529d
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 124 | + | |
| 125 | + | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| |||
0 commit comments