cpython/Tools/ftscalingbench
Sam Gross fa3143a1d2
[3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088)
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.

(cherry picked from commit e0f7c1097e)
2026-03-19 10:49:12 -04:00
..
ftscalingbench.py [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00