GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [WIP] bpo-39465: Optimize _PyInterpreterState_GET() by vstinner · Pull Request #20767 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jun 9, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner vstinner added the skip news label Jun 9, 2020
@vstinner
vstinner requested a review from pablogsal as a code owner June 9, 2020 21:58
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 9, 2020
@bedevere-bot bedevere-bot added the awaiting core review label Jun 9, 2020
@vstinner
vstinner marked this pull request as draft June 9, 2020 23:46
@vstinner vstinner changed the title bpo-39465: Optimize _PyInterpreterState_GET() [WIP] bpo-39465: Optimize _PyInterpreterState_GET() Jun 9, 2020
@vstinner

vstinner commented Jun 9, 2020

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
bpo-39465: Optimize _PyInterpreterState_GET()
ee981f0
* Add _PyRuntimeState.gilstate.interp_current.
* _PyThreadState_Swap() now sets interp_current.
  PyThreadState_Swap(NULL) sets interp_current to NULL.
@vstinner vstinner mentioned this pull request Jun 11, 2020
Travis CI doesn't report its status or doesn't run on Python pull requests python/core-workflow#371
Closed
@vstinner vstinner mentioned this pull request Jun 23, 2020
bpo-40521: Make dict free lists per-interpreter #20645
Merged
@vstinner vstinner closed this Dec 23, 2020
@vstinner
vstinner deleted the interp_current branch December 23, 2020 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.