◐ Shell
clean mode source ↗

[WIP] bpo-39465: Optimize _PyInterpreterState_GET() by vstinner · Pull Request #20767 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@vstinner

  • Add _PyRuntimeState.gilstate.interp_current.

  • _PyThreadState_Swap() now sets interp_current.
    PyThreadState_Swap(NULL) sets interp_current to NULL.

  • Replace _PyThreadState_GET() with _PyInterpreterState_GET() in:

    • get_small_int()
    • gcmodule.c: add also get_gc_state() function
    • _PyTrash_deposit_object()
    • _PyTrash_destroy_chain()
    • warnings_get_state()
    • Py_GetRecursionLimit()

https://bugs.python.org/issue39465

@vstinner vstinner changed the title bpo-39465: Optimize _PyInterpreterState_GET() [WIP] bpo-39465: Optimize _PyInterpreterState_GET()

Jun 9, 2020

@vstinner

I'm still working on measuring the optimization performance. So far, the benefit is not obvious.

* Add _PyRuntimeState.gilstate.interp_current.
* _PyThreadState_Swap() now sets interp_current.
  PyThreadState_Swap(NULL) sets interp_current to NULL.

Labels