You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument Clinic now generates less efficient code using _PyArg_ParseStackAndKeywords instead of _PyArg_UnpackKeywords. It is a regression introduced after establishing module state. For example see #23393. It may be a cause of #91404.
No, but _PyArg_ParseStackAndKeywords adds some overhead, and I do not see reason of not using more efficient code here. It seems that adding the implicit cls parameter broke some checks in Argument Clinic. These checks should ignore that parameter (as they ignore self), it does not affect the parsing code.
I do not see reason of not using more efficient code here
+1
It seems that adding the implicit cls parameter broke some checks in Argument Clinic. These checks should ignore that parameter (as they ignore self), it does not affect the parsing code.
In sqlite3, for the sqlite3.Connection class, I store a pointer to the module state in the class context. A module state lookup in any of the connection methods is simply a class context member lookup. We could do a similar optimisation here.
Activity
erlend-aasland commentedon Apr 15, 2022
FYI GH-23393 is also in 3.10, not just 3.11 (seeing that GH-91404 has the title Possible slowdown of regex searching in 3.11)
erlend-aasland commentedon Apr 15, 2022
Did you benchmark the difference?
serhiy-storchaka commentedon Apr 15, 2022
No, but
_PyArg_ParseStackAndKeywordsadds some overhead, and I do not see reason of not using more efficient code here. It seems that adding the implicitclsparameter broke some checks in Argument Clinic. These checks should ignore that parameter (as they ignoreself), it does not affect the parsing code.erlend-aasland commentedon Apr 15, 2022
+1
In sqlite3, for the sqlite3.Connection class, I store a pointer to the module state in the class context. A module state lookup in any of the connection methods is simply a class context member lookup. We could do a similar optimisation here.
pythongh-91583: AC: Fix regression for functions with defining_class
serhiy-storchaka commentedon Apr 20, 2022
METH_METHODwas introduced in 3.9, and Argument Clinic support was added at the same time.gh-91583: AC: Fix regression for functions with defining_class (GH-91739
[3.10] pythongh-91583: AC: Fix regression for functions with defining…
[3.9] pythongh-91583: AC: Fix regression for functions with defining_…
[3.10] gh-91583: AC: Fix regression for functions with defining_class (…
[3.9] gh-91583: AC: Fix regression for functions with defining_class (G…
[3.9] pythongh-91583: AC: Fix regression for functions with defining_…