| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
my_StartElementHandler() builds a new dictionary for unordered element
attributes. Use _PyDict_SetItem_Take2() there so the dictionary insertion
consumes the newly created key and value directly, removing the matching
Py_DECREF() calls on both the success and error paths.
This keeps the existing behavior and error handling while doing less reference
count work.
Benchmark
Benchmarks used pyperf 2.10.0 on CPython main 3.16.0a0 at revision
8b048eb35e, built for Windows x64 with the official PCbuild PGO/PGUpdate
configuration and link-time code generation. Baseline and patched runs used the
same interpreter and PGO profile; only the pyexpat extension binary was
swapped. Each worker used CPU 1 affinity and high process priority.
The workloads parse complete XML documents with:
Regular build:
Free-threaded build (Py_GIL_DISABLED=1, sys._is_gil_enabled() == False):
pyperf check reported both free-threaded result files as stable. The benchmark
is single-threaded, including on the free-threaded interpreter, so it measures
the direct parsing cost rather than concurrent scalability.
Validation