Skip to content
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

gh-89536: Use ThinLTO policy if possible #96766

Merged
merged 2 commits into from
Sep 16, 2022
Merged

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Sep 12, 2022

  • Build time with the --with-lto flag (AS-IS: LTO): 112.02 secs
  • Build time with the --with-lto flag (TO-BE: ThinLTO): 56.150 secs (almost 2x faster)

Both builds were done with M1 Pro CPU

@corona10
Copy link
Member Author

cc @matthiasgoergens

@corona10 corona10 requested a review from tiran September 12, 2022 09:56
@corona10
Copy link
Member Author

corona10 commented Sep 12, 2022

I will wait for @ned-deily 's review as the final reviewer since he is the expert on macOS releases.

@corona10 corona10 changed the title gh-89536: Use thinLTO policy if possible gh-89536: Use ThinLTO policy if possible Sep 12, 2022
@matthiasgoergens
Copy link
Contributor

Should we do a performance benchmark of the generated executable?

@corona10
Copy link
Member Author

corona10 commented Sep 12, 2022

@matthiasgoergens
My last attempt did not give a significant impact but it was measured by VM, checking the benchmark result at this moment would be valuable.
#88506 (comment)

@matthiasgoergens
Copy link
Contributor

Thanks!

Ha, I should learn how this pyperformance module works for my own experiments. Thanks for linking to that comment.

@corona10
Copy link
Member Author

corona10 commented Sep 12, 2022

@ned-deily @methane cc @matthiasgoergens

https://gist.github.com/corona10/40d48caebb498ade456d2332c4fa430e

Here is the latest benchmark with my local macOS environment(not fully isolated) when applying only LTO optimization.

@corona10
Copy link
Member Author

corona10 commented Sep 12, 2022

Here is the PGO + LTO benchmark (consistently 3-4% faster :))

https://gist.github.com/corona10/60d73e610f14661e131ed9037eab4d38

Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@corona10 corona10 merged commit e47b96c into python:main Sep 16, 2022
@corona10 corona10 deleted the gh-89536 branch September 16, 2022 10:40
@corona10
Copy link
Member Author

Thank you @ronaldoussoren and @methane

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 this pull request may close these issues.

5 participants