bpo-42235: [macOS] Use LTO/PGO in build-installer.py with new enough compilers#23079
bpo-42235: [macOS] Use LTO/PGO in build-installer.py with new enough compilers#23079ned-deily merged 4 commits intopython:masterfrom
Conversation
With recent enough compilers we can build binaries with LTO/PGO on macOS. This patch enables this when building on macOS 10.15 or later (Xcode 11 or later).
|
Note that this PR requires #22855 to be actually useful, as that introduces "universal2" as a new set of universal arch, and that's the only set of architectures that can actually be build on 10.15 (when using the current Xcode 12 beta). I've marked this PR as "DO-NO-MERGE" because I don't want to merge this before #22855. |
I started to use draft PRs rather than using this label, to prevent mistakes. |
|
@ned-deily I've been pretty conservative in this PR by only enabling the optimisations on macOS 10.15 or later. That's because I expect that we'll end up building installers with the latest version of Xcode. Both because the latest version is needed to build for arm64, and because newer compilers tend to have improved code generation. BTW. I haven't tested yet what the performance improvement is. I think it would be interesting to run pyperformance with and without LTO+PGO to see how much it will buy us on macOS (although I'd assume there would be similar gains as on other platforms). |
ned-deily
left a comment
There was a problem hiding this comment.
LGTM in principle. Will test later.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. @ned-deily already approved this PR, so @ronaldoussoren please merges it ;-)
I didn't check if macOS 10.15 supports LTO+PGO, but I trust @ronaldoussoren who knows macOS way better than me :-D
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
|
Still awaiting testing by me. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Thanks @ronaldoussoren for the PR, and @ned-deily for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
…compilers (pythonGH-23079) With recent enough compilers we can build binaries with LTO/PGO on macOS. This patch enables this when building on macOS 10.15 or later (Xcode 11 or later). (cherry picked from commit e08059e) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
|
GH-25831 is a backport of this pull request to the 3.9 branch. |
…compilers (pythonGH-23079) With recent enough compilers we can build binaries with LTO/PGO on macOS. This patch enables this when building on macOS 10.15 or later (Xcode 11 or later). (cherry picked from commit e08059e) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
|
GH-25832 is a backport of this pull request to the 3.8 branch. |
This PR enables
--with-optimizationsin build-installer.py when using a new enough compiler.For now "new enough" is gated on being on macOS 10.15 or later, as that's what I've tested with.
https://bugs.python.org/issue42235