Commit 332d608
Tune the merge threshold and stack size
Merge a new value with stacked values while it has at least 3/4
(instead of 1/2) as many digits: this matches the balanced pairing
of equal-sized arguments while keeping the size adaptivity, and
removes the slowdown for many equal-sized arguments.
Cache the digit counts of stacked values in a parallel array.
Since entry sizes now grow at least 4/3 times (instead of 2 times)
per entry, enlarge the stack from 8*sizeof(Py_ssize_t) to
24*sizeof(Py_ssize_t) entries, which covers the new depth bound
of log(PY_SSIZE_T_MAX)/log(4/3) + 1.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 1ee08c8 commit 332d608
1 file changed
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | | - | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
| 137 | + | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
0 commit comments