Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Jan 29, 2026

Add _Py_type_getattro_stackref, a variant of type attribute lookup that returns _PyStackRef instead of PyObject*. This allows returning deferred references in the free-threaded build, reducing reference count contention when accessing type attributes.

This improves scaling of namedtuple instantiation across multiple threads.

Add `_Py_type_getattro_stackref`, a variant of type attribute lookup
that returns `_PyStackRef` instead of `PyObject*`. This allows returning
deferred references in the free-threaded build, reducing reference count
contention when accessing type attributes.

This significantly improves scaling of namedtuple instantiation across
multiple threads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant