Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-111786: Turn off optimize for speed for _PyEval_EvalFrameDefault on MSVC#111794
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
gvanrossum left a comment
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.
LGTM. @markshannon or @brandtbucher can merge if they agree.
markshannon left a comment
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.
3-10% faster and fixes the build. Sounds good to me 🙂
I'd like @zooba's approval though, in case we missed something.
zooba commented Nov 7, 2023
My only question would be whether we know that turning The results seem to be okay for PGO builds, but regular builds may suffer a regression if optimisation is just turned off. (For debug builds we have it off deliberately, and would want to avoid turning it on.) |
mdboom commented Nov 7, 2023
Converting to draft -- I'm seeing some non-determinacy to this fix, so we should hold off on merging until I get to the bottom of it. |
brandtbucher commented Nov 7, 2023
I see this has been re-opened. Did you figure out the issue? If so, it looks like it's ready to merge (assuming we aren't seeing a regression on non-PGO builds). |
mdboom commented Nov 7, 2023
I couldn't find a way to directly introspect this. However, I decided to try to forcibly turn "s" on after turning "t" off and compare the results to this PR, e.g.: Using SizeBench, I was able to confirm that both that and this PR generate the same size code for So that (might be) indirect evidence at least that we still get size optimization this way. |
mdboom commented Nov 7, 2023
Yes, it was entirely me not seeing the difference between
I just fired off some benchmarking runs to test the effect of this on non-PGO builds. It will take a few hours to get the results back. |
brandtbucher commented Nov 7, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I blame "that's a rough API design". |
zooba commented Nov 7, 2023
Unoptimised code will be huge by comparison - 2x or more. Sounds like we're still getting the optimization. |
mdboom commented Nov 7, 2023
And some level of PGO is still happening, as evidenced by the split into hot and cold paths.
Unfortunately, it seems this causes an 11% regression on non-PGO builds. (This is comparing non-PGO or this PR vs. a non-PGO build of its base 9f33ede). If we care about this (I'm not sure we do -- that's a question for someone with more knowledge of the history of Windows builds). We can probably disable this |
zooba commented Nov 7, 2023
FYI, I'd suggest |
mdboom commented Nov 8, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I have updated this to only disable the optimization when doing a PGO build.
EDIT: I take that back -- with a clean build this works, and is simpler. |
gvanrossum left a comment
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.
LGTM. Let me know when you're ready for this to be merged.
mdboom commented Nov 8, 2023
@gvanrossum: As far as I know this is ready, but maybe @zooba should have one more quick look. |
gvanrossum commented Nov 9, 2023
I'm just going to merge it, it looks great. |
…SVC for PGO (python#111794) In PGO mode, this function caused a compiler error in MSVC. It turns out that optimizing for space only save the day, and is even faster. However, without PGO, this is neither necessary nor slower.
…SVC for PGO (python#111794) In PGO mode, this function caused a compiler error in MSVC. It turns out that optimizing for space only save the day, and is even faster. However, without PGO, this is neither necessary nor slower.
Uh oh!
There was an error while loading. Please reload this page.