[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

Ken Jin report at bugs.python.org
Fri Sep 17 05:58:33 EDT 2021


Ken Jin <kenjin4096 at gmail.com> added the comment:

@neonene
Thanks for the truly excellent investigation!

@Raymond and @Steve,
If I understood OP (neonene) properly, changing Py_DECREF to a macro won't get back the entire 7% lost performance in pyperformance. neonene's investigations suggest that the entire eval function is now too big for PGO on MSVC. Fixing Py_DECREF may get us a few %, but all the other hot functions in eval are likely not being inlined as well. Their suggested patch in https://bugs.python.org/msg401743 works, but IMO, _may_ slow down DISPATCH() _slightly_ since it seems to introduce another jump.

I suggest using their patch only for MSVC until we think of something better in 3.11. The additional jump may not matter after PGO (and it surely isn't a 7% slowdown :). WDYT?

----------
priority: normal -> high

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45116>
_______________________________________


More information about the Python-bugs-list mailing list