Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-111786: Use separate opcode vars for Tier 1 and Tier 2 #112289

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Nov 20, 2023

Suggested by @neonene: #111786 (comment)

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

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

@gvanrossum gvanrossum left a 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?

Python/ceval.c Outdated
Comment on lines 692 to 693
uint8_t opcode; /* Current opcode */
int oparg; /* Current opcode argument, if any */
Copy link
Member

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. :-)

Copy link
Contributor Author

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.

Python/ceval.c Show resolved Hide resolved
@mdboom
Copy link
Contributor Author

mdboom commented Nov 20, 2023

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.

@gvanrossum
Copy link
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?

@mdboom
Copy link
Contributor Author

mdboom commented Nov 20, 2023

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).

@gvanrossum
Copy link
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!

@gvanrossum gvanrossum merged commit 6a00a58 into python:main Nov 20, 2023
23 checks passed
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…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
…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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants