Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork249
Update Windows builds to use ClangCL#549
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| f"/property:DefaultWindowsSDKVersion={windows_sdk_version}", | ||
| # Use ClangCL for better build and runtime performance | ||
| # https://github.com/python/cpython/issues/130090 | ||
| "/p:PlatformToolset=ClangCL", |
Fidget-SpinnerMar 5, 2025 • 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.
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, requirespython/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 forpython/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.
zanieb commentedMar 5, 2025
The latest benchmark is atpython/cpython#129907 (comment) which shows some regressions, but an average 19% improvement. |
zanieb commentedMar 18, 2025
Interesting, it failed with |
chris-eibl commentedMar 18, 2025
AFAIR this means it is compiling in 323bit mode. Try adding Interesting, according topython/cpython@d8a1cf4 this should be part ofv3.14.0a6 |
chris-eibl commentedMar 18, 2025
But I see it is passed e.g. here: but not here But in the line above for |
chris-eibl commentedMar 18, 2025
Try adding "/p:PreferredToolArchitecture=x64". Beforepython/cpython@263870d that was the trick that did it for me. Maybe it is still needed, although I back then did not need it anymore. That was a back and forth. I will re-investigate ... |
zanieb commentedMar 18, 2025
We also do some non-standard things (like, we hack the project files), so it's possible it's a problem there. |
chris-eibl commentedMar 18, 2025
Interestingly, I can reproduce on cpython main and alpha6. I cannot build without Need some sleep though now :) |
zanieb commentedMar 18, 2025
Cool that gets us to which is from the copy at python-build-standalone/cpython-windows/build.py Lines 1072 to 1079 in0935643
I presume this file is not produced upstream as well? I don't know if it's of consequence — I'm woefully lacking in knowledge of |
chris-eibl commentedMar 19, 2025
Ok, I've dug deeper this time - please seepython/cpython#131473 for details. Regarding the |
zanieb commentedMar 19, 2025
A nice improvement in build times
|
Fidget-Spinner commentedMar 28, 2025
Tail calling for Windows clangcl has been mergedhttps://github.com/python/cpython/pull/130040/files#diff-4295039788386c2986b811f2a6b59cf088be59822b24b4f1243c9e9b184f65fbR109 |
Uh oh!
There was an error while loading.Please reload this page.
Adding the flag as described inpython/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.