Skip to content

gh-132312: Significantly reduce thread state lookups in the interpreter#151453

Draft
ZeroIntensity wants to merge 12 commits into
python:mainfrom
ZeroIntensity:tstate-bonanza
Draft

gh-132312: Significantly reduce thread state lookups in the interpreter#151453
ZeroIntensity wants to merge 12 commits into
python:mainfrom
ZeroIntensity:tstate-bonanza

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Jun 13, 2026

Copy link
Copy Markdown
Member

This does a lot of refactoring to avoid repeated _PyThreadState_GET calls in hot code paths (primarily the eval loop + common object operations).

Most of the changes here are mechanical, but I did have to make some more convoluted changes to make this robust (such as the addition of _Py_DECREF and such).

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