-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Update Windows builds to use ClangCL #549
base: main
Are you sure you want to change the base?
Conversation
@@ -653,6 +653,9 @@ def run_msbuild( | |||
# This can also work around known incompatibilities with the Windows 11 | |||
# SDK as of at least CPython 3.9.7. | |||
f"/property:DefaultWindowsSDKVersion={windows_sdk_version}", | |||
# Use ClangCL for better build and runtime performance | |||
# https://github.com/python/cpython/issues/130090 | |||
"/p:PlatformToolset=ClangCL", |
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.
Probably should guard only on 3.14. (It's the first version with Clang PGO, that will guarantee better performance).
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.
Also, requires python/cpython#130040 to pass on CI. For some reason there's a one line patch required.
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.
If you are using clang versions below 19, this will furthermore need a fix for python/cpython#130213, due to the problems with intrinsics.
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.
We're using LLVM 19 here (and presumably 20 soon — #553) actually, realized we're only setting up a LLVM toolchain on Unix right now. I will look into the version we're using on Windows.
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.
We should teach the build system to pull a pre-built LLVM toolchain from somewhere. The official releases from e.g. https://github.com/llvm/llvm-project/releases/tag/llvmorg-20.1.0 should be fine.
If we use the toolchain built into the GitHub Actions Runner, it will randomly be updated out from under us. Given some sensitivity we've seen around LLVM versions lately, this spooky-action-at-a-distance will likely randomly cause CI to fail.
Best to make CI as deterministic and reproducible as possible.
The latest benchmark is at python/cpython#129907 (comment) which shows some regressions, but an average 19% improvement. |
Adding the flag as described in python/cpython#129907
ClangCL looks to provide a 20% runtime performance and build times were purportedly better as well.
This also would let us turn on the tail-calling interpreter for another 10% performance boost.
Waiting to test this until the new CPython 3.14 alpha is out.