gh-120771: Refactor xml.etree.ElementTree._namespaces#120772
gh-120771: Refactor xml.etree.ElementTree._namespaces#120772danifus wants to merge 3 commits intopython:mainfrom
Conversation
|
@serhiy-storchaka are you able to review this please? For some more context, this refactor is to replace the I did a bit more profiling / experimentation and found that the key variable affecting performance was the number of namespaces used. The more unique namespaces, the worse the performance (beyond 85% unique namespaces this patch is slightly slower than |
|
This PR is stale because it has been open for 30 days with no activity. |
The refactor also makes
_namespacesslightly faster in most scenarios except when more than ~85% of tags are unique and qualified with a namespace. Above 85% it performs similarly to the current implementation. See below for the benchmark code.and some results using this PR:
main:
xml.etree.ElementTree._namespaces#120771