Skip to content

Store current interpreter as a thread local variable #140544

Description

@kumaraditya303

There's a lot of code which accesses the current interpreter state especially under free-threading via PyInterpreterState_Get. Currently to lookup interpreter state first the thread state is accessed then read by ts->interp but it can be optimized to be stored in a thread local variable _Py_tss_current_interp so that it can be read directly.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions