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
{{ message }}
Repository navigation
Free-threaded builds can experience heavy contention on PyType_IsSubtype #116868
PyType_IsSubtype takes the type lock to ensure that MRO is being accessed in a thread-safe manner as it needs to read and incref it. This can result in heavy contention in some pretty common scenarios (e.g. when sys.setprofile is used we experience heavy contention across threads doing PyCFunction_Check, profiling simple workloads can be nearly 50% slower in some cases). We can avoid this by using Py_TryIncref and only fallback to the lock when the MRO isn't yet shared.
Activity
gh-116868: Avoid locking in PyType_IsSubtype (#116829)
pythongh-116868: Avoid locking in PyType_IsSubtype (python#116829)
pythongh-116868: Avoid locking in PyType_IsSubtype (python#116829)
pythongh-116868: Avoid locking in PyType_IsSubtype (python#116829)