Skip to content

Use PGO on macOS x64 and arm64 builds #19611

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

Merged
merged 1 commit into from
Apr 17, 2025
Merged

Conversation

zamazan4ik
Copy link
Contributor

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 16, 2025
@lnicola
Copy link
Member

lnicola commented Apr 17, 2025

You can test this by adding on: pull_request and making it fail like in https://github.com/rust-lang/rust-analyzer/pull/19602/files.

@lnicola
Copy link
Member

lnicola commented Apr 17, 2025

I guess it's easier to merge and revert if necessary.

@lnicola lnicola added this pull request to the merge queue Apr 17, 2025
Merged via the queue into rust-lang:master with commit 672c11e Apr 17, 2025
14 checks passed
@zamazan4ik
Copy link
Contributor Author

So, it doesn't work: https://github.com/rust-lang/rust-analyzer/actions/runs/14510906031/job/40709149737

As far as I understand, this due to that we use x86-64 macOS image instead of ARM image: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md . Are we allowed to use ARM macOS machines for RA? If yes, we can try to change the image and try once again.

@lnicola
Copy link
Member

lnicola commented Apr 17, 2025

#19614

You can already test it in the nightly.

@lnicola
Copy link
Member

lnicola commented Apr 17, 2025

Ha! I just saw someone link to https://www.youtube.com/watch?v=_EpALMNXM24.

@zamazan4ik
Copy link
Contributor Author

PGO world is not so big nowadays, yeah :D

@lnicola
Copy link
Member

lnicola commented Apr 17, 2025

And look:

image

@zamazan4ik
Copy link
Contributor Author

As I did previously in #19585 (comment) for Windows - now we test PGO vs non-PGO RA for macOS!

Environment:

For benchmark purposes, I used rust-analyzer analysis-stats --run-all-ide-things <rust-analyzer-checkout-directory> command. Measurements are done multiple times, in different orders, etc. First runs are skipped to avoid any first-time-run fluctuations (like "XProtectService" or other "magic" stuff). The results are pretty stable across runs.

Results (the Total number at the end of the execution. Providing the full log will be too lengthy):

  • No PGO: 140s
  • PGO: 110s

So we can conclude that PGO for RA works well for macOS platform too.

I didn't test x86 macOS version (I am a bit lazy to run it under Rosetta2) but I expect exactly the same performance wins for that platform too. As far as I understand, RA in CI uses x86 macOS images to build x86 macOS RA version, so no PGO issues due to cross-compilation should appear. If anyone wants to test it and report the results back - it would be nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants