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 — bpo-43760: Streamline dispatch sequence for machines without computed gotos. by markshannon · Pull Request #25244 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Apr 7, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Do fetch and decode at end of opocde then jump directly to switch.
    Should allow compilers that don't support computed-gotos, specifically MSVC,
    to generate better code.

  • Cleans up the code

This should have no effect when computed gotos are used.

https://bugs.python.org/issue43760

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 7, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Apr 7, 2021
@markshannon markshannon added the skip news label Apr 7, 2021
@markshannon

markshannon commented Apr 7, 2021

Copy link
Copy Markdown
Member Author

Skipping NEWS, as this shouldn't have any noticeable effect. I'll add a NEWS item to the other PR for https://bugs.python.org/issue43760 as that should have a (just?) measurable effect.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
markshannon force-pushed the dispatch-refactor branch 2 times, most recently from feffa76 to d90907f Compare April 7, 2021 11:44
@markshannon
Streamline dispatch sequence for machines without computed gotos.
82d2cd0
* Do fetch and decode at end of opocde then jump directly to switch.
  Should allow compilers that don't support computed-gotos, specifically MSVC,
  to generate better code.
@markshannon
markshannon force-pushed the dispatch-refactor branch from d90907f to 82d2cd0 Compare April 7, 2021 11:45
@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 7, 2021
@bedevere-bot

bedevere-bot commented Apr 7, 2021

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 82d2cd0 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 7, 2021
@markshannon
Restore stack_pointer before jumping to error handling, in case trace…
860ca09
… function changed frame *and* raised an exception.
@rhettinger

rhettinger commented Apr 7, 2021

Copy link
Copy Markdown
Contributor

Thanks for doing this. It looks like a nice improvement.

Why did you switch to uint8_t? That doesn't seem consistent with the rest of the code.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented Apr 8, 2021

Copy link
Copy Markdown
Member Author

@rhettinger
The primary reason for the change to uint8_t will be in later PR. If we add cases for all unknown opcodes then the compiler will know that the cases are exhaustive and won't need to emit bounds checks when dispatching.
I'll revert it to int for now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
Clarifications suggested by GvR and R Hettinger.
99a0871
@markshannon markshannon mentioned this pull request Apr 8, 2021
Faster tracing test faster-cpython/cpython#6
Closed
@markshannon
markshannon merged commit 28d28e0 into python:master Apr 8, 2021
@bedevere-bot bedevere-bot removed the awaiting core review label Apr 8, 2021
@markshannon
markshannon deleted the dispatch-refactor branch April 8, 2021 10:43
@neonene neonene mentioned this pull request Sep 29, 2021
bpo-45116 Fix another performance regression on Windows #28630
Closed
@markshannon markshannon mentioned this pull request Sep 13, 2022
The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) #87926
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

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.

4 participants

@markshannon @bedevere-bot @rhettinger @the-knights-who-say-ni
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.