Skip to content

On Clang, LTO is ThinLTO, which leaves a lot of performance out for macOS #528

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

Closed
Fidget-Spinner opened this issue Feb 12, 2025 · 2 comments

Comments

@Fidget-Spinner
Copy link

Fidget-Spinner commented Feb 12, 2025

The LTO flag is passed in as ``--with-lto`

CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto"

However, on version 3.12 and higher, Clang defaults to the ThinLTO policy https://docs.python.org/3.14/using/configure.html#cmdoption-with-lto

This leaves quite a bit of perf on the table for macOS on 3.13 and higher python/cpython#122580

The fix should be to pass it --with-lto=full on 3.12 and higher.

@Fidget-Spinner
Copy link
Author

Note that this might make builds take 2x time for LTO!

@Fidget-Spinner
Copy link
Author

Not reproducible in upstream clang. So this might be an Apple Clang bug.

@Fidget-Spinner Fidget-Spinner closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant