Repository navigation
Commit 1427d8e
test: Fix flaky cookie unquoting linear-performance test on PyPy
test_unquote_linear_performance failed intermittently on PyPy with a
ratio just over its limit of 20. It was not timer noise: each sample is
already at least 0.1s and the minimum of several. Three things were
wrong:
* assert_linear_scaling disabled the GC on every implementation. On PyPy
that only stops major collections, so objects promoted out of the
nursery pile up for the whole measurement (about 1MB per call here),
and the larger input pays for touching fresh memory. This inflated
the ratio of linear code to 20-90 depending on PYPY_GC_NURSERY. The
GC is now only disabled on CPython.
* Even without that, this test allocates heavily per input byte and its
PyPy ratio depends on the nursery and cache sizes (11-24 measured), so
its limit is raised to 40. The quadratic 6.4.1 implementation measures
about 100 on CPython and 60-100 on PyPy.
* The quick measurement timed n1 first, before PyPy's JIT had warmed up,
which inflated it enough that the quadratic 6.4.1 implementation passed
this test on PyPy. A warmup now precedes it.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0168zU4yXrAsAoY3KAWuiE8n1 parent a4dd782 commit 1427d8e
2 files changed
Lines changed: 50 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
820 | 827 | | |
821 | 828 | | |
822 | 829 | | |
823 | 830 | | |
824 | 831 | | |
825 | 832 | | |
826 | | - | |
| 833 | + | |
827 | 834 | | |
828 | 835 | | |
829 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
231 | 263 | | |
232 | 264 | | |
233 | 265 | | |
| |||
255 | 287 | | |
256 | 288 | | |
257 | 289 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 290 | + | |
| 291 | + | |
262 | 292 | | |
263 | 293 | | |
264 | 294 | | |
| |||
275 | 305 | | |
276 | 306 | | |
277 | 307 | | |
278 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
279 | 313 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 314 | + | |
| 315 | + | |
283 | 316 | | |
284 | 317 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | 318 | | |
289 | 319 | | |
290 | 320 | | |
291 | 321 | | |
292 | | - | |
293 | | - | |
294 | | - | |
| 322 | + | |
295 | 323 | | |
296 | 324 | | |
297 | 325 | | |
298 | 326 | | |
299 | 327 | | |
300 | 328 | | |
301 | 329 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | 330 | | |
306 | 331 | | |
307 | 332 | | |
| |||
0 commit comments