Uh oh!
There was an error while loading. Please reload this page.
gh-145685: Avoid contention on TYPE_LOCK in super() lookups - #145775
Conversation
mpage
left a comment
There was a problem hiding this comment.
LGTM. Should we add a test to the scaling benchmark that reproduces the issue?
| _PyThreadState_PushCStackRef(tstate, &mro_ref); | ||
| mro_ref.ref = PyStackRef_FromPyObjectNew(mro); |
There was a problem hiding this comment.
Doesn't need to be in this PR, but would it be worth adding another function that combines these two operations?
colesbury
commented
Mar 11, 2026
This is enough to fix classBase:
defmethod(self):
return1classDerived(Base):
defmethod(self):
returnsuper().method()
@register_benchmarkdefsuper_call():
obj=Derived()
for_inrange(1000*WORK_SCALE):
obj.method() |
colesbury
commented
Mar 11, 2026
Actually, maybe it's worth adding the different class benchmark now and I'll update it later. |
Uh oh!
There was an error while loading. Please reload this page.
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, @colesbury, I could not cleanly backport this to |
…ups (pythongh-145775) (cherry picked from commit bdf6de8) Co-authored-by: Sam Gross <colesbury@gmail.com>
GH-145804 is a backport of this pull request to the 3.14 branch. |
_PyType_Lookup/_PyType_LookupStackRefAndVersion#145685