-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
[3.10] bpo-45116: Fix inlining regressions on Windows Release build #31459
Conversation
_Py_NO_INLINE: MSVC inlines unknown_opcode_error() with no performance down, which is too uncommon to be inlined.
The build machines have the same log as mine: Inlining decisions before the fix (x64)
Although they are inlined sequentially, sorting case branches by frequency has a little effect (1%). |
Inlining decisions after the fix (x64)
|
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.
Are you serious that replacing just those five lines (two calls) with one is enough to make the compiler inline everything again?
The inliner should work again on 3.10.2+ Release as 2d3cb28 shows in the build logs. Other code blocks may need to be replaced in the future. Using cl.exe with |
Oh I see, this is for 3.10 only. For 3.11 we'll have to do something else -- probably we'll first have to instrument things using #31436 . @zooba What do you think of merging this into 3.10? The evidence seems reasonable, although it's one of those rare PRs that should only be merged for a version branch. |
3.11 should be focused on now. |
The main interpreter loop needs to shrink a bit to keep small functions there inlined consistently.
3.10.2+ (f1916cd)
Benchmark x64 1.03x recovery
Benchmark x86 1.04x recovery
PGO builds don't change performance with this.
https://bugs.python.org/issue45116