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 — gh-111786: Use separate opcode vars for Tier 1 and Tier 2 by mdboom · Pull Request #112289 · python/cpython

Conversation

@mdboom

@mdboom mdboom commented Nov 20, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Suggested by @neonene: #111786 (comment)

This makes Windows about 3% faster on pyperformance benchmarks. See analysis here

  • Issue: PGO build broken on Windows #111786

Sorry, something went wrong.

Uh oh!

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

neonene reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@mdboom
mdboom requested review from gvanrossum and markshannon as code owners November 20, 2023 20:22
@bedevere-app bedevere-app Bot added the awaiting review label Nov 20, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Nov 20, 2023
PGO build broken on Windows #111786
Closed
@mdboom mdboom added the skip news label Nov 20, 2023
@mdboom
mdboom force-pushed the alternative-workaround branch from 00a506a to 27a5654 Compare November 20, 2023 20:24
@mdboom
pythongh-111786: Use separate opcode vars for Tier 1 and Tier 2
f362f9a
This makes Windows about 3% faster on pyperformance benchmarks.
@mdboom
mdboom force-pushed the alternative-workaround branch from 27a5654 to f362f9a Compare November 20, 2023 20:26
gvanrossum
gvanrossum approved these changes Nov 20, 2023
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks very straightforward.

Though based on our offline conversation, did you find out whether Windows PGO uses -E?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Python/ceval.c Outdated
Comment on lines +692 to +693
uint8_t opcode; /* Current opcode */
int oparg; /* Current opcode argument, if any */

@gvanrossum gvanrossum Nov 20, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I would have kept the comments at the same column, so you don't appear to be editing the oparg line. :-)

Sorry, something went wrong.

Uh oh!

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

All reactions

@mdboom mdboom Nov 20, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure -- I think my editor did something magical.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Python/ceval.c Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Nov 20, 2023
@mdboom
Restore indentation
d452c37
@mdboom

mdboom commented Nov 20, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Though based on our offline conversation, did you find out whether Windows PGO uses -E?

I don't know, but I think that's orthogonal to this. Currently on the benchmarking infrastructure, we only pass the PYTHON_UOPS env variable to pyperformance, so it definitely has no effect during build. Independently of this, I measured what happens when you force Tier 2 on during the build, and it is about 1% faster.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented Nov 20, 2023

Copy link
Copy Markdown
Member

Though based on our offline conversation, did you find out whether Windows PGO uses -E?

I don't know, but I think that's orthogonal to this. Currently on the benchmarking infrastructure, we don't pass the PYTHON_UOPS env variable to pyperformance, so it definitely has no effect during build.

Ah, sorry. Should I merge this then?

Independently of this, I measured what happens when you force Tier 2 on during the build, and it is about 1% faster.

1% faster than without Tier 2, or 1% faster than main?

All reactions

Sorry, something went wrong.

Uh oh!

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

gvanrossum
gvanrossum approved these changes Nov 20, 2023
View reviewed changes
@mdboom

mdboom commented Nov 20, 2023

Copy link
Copy Markdown
Contributor Author

Though based on our offline conversation, did you find out whether Windows PGO uses -E?

I don't know, but I think that's orthogonal to this. Currently on the benchmarking infrastructure, we don't pass the PYTHON_UOPS env variable to pyperformance, so it definitely has no effect during build.

Ah, sorry. Should I merge this then?

Yeah, I think that's fine.

Independently of this, I measured what happens when you force Tier 2 on during the build, and it is about 1% faster.

1% faster than without Tier 2, or 1% faster than main?

When you turn Tier 2 on during build (PGO collection), it's 1% faster than if you don't. (Using Tier 2 at runtime in both cases).

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented Nov 20, 2023

Copy link
Copy Markdown
Member

When you turn Tier 2 on during build (PGO collection), it's 1% faster than if you don't. (Using Tier 2 at runtime in both cases).

That's great news!

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum
gvanrossum merged commit 6a00a58 into python:main Nov 20, 2023
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 20, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@mdboom @aisk
pythongh-111786: Use separate opcode vars for Tier 1 and Tier 2 (pyth…
95de6df
…on#112289)

This makes Windows about 3% faster on pyperformance benchmarks.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@mdboom @Glyphack
pythongh-111786: Use separate opcode vars for Tier 1 and Tier 2 (pyth…
c64d740
…on#112289)

This makes Windows about 3% faster on pyperformance benchmarks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

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.

2 participants

@mdboom @gvanrossum
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.