gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (#145826)
Add special cases for classmethod and staticmethod descriptors in _PyObject_GetMethodStackRef() to avoid calling tp_descr_get, which avoids reference count contention on the bound method and underlying callable. This improves scaling when calling classmethods and staticmethods from multiple threads. Also refactor method_vectorcall in classobject.c into a new _PyObject_VectorcallPrepend() helper so that it can be used by PyObject_VectorcallMethod as well.
S
Sam Gross committed
e0f7c1097e19b6f5c2399e19f283c9fb373c243f
Parent: 966fc81
Committed by GitHub <noreply@github.com>
on 3/17/2026, 6:24:44 PM