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

Add information about PGO and BOLT effects on Rustc performance to the documentation #115251

Closed
zamazan4ik opened this issue Aug 26, 2023 · 5 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@zamazan4ik
Copy link
Contributor

Location

Don't know the right place for this information - needs to be clarified.

Summary

The official Rustc distribution is not the only Rustc binary version, which is used by Rust users. E.g. there are provided by multiple OS packages (like Fedora rust package) or even built in-house Rustc version (due to some not-so-rare specific security requirements).

According to the great @Kobzol work, PGO and LLVM BOLT helps a lot with optimizing Rustc performance. We need to document somewhere the PGO and BOLT benefits for rustc performance and a guide - how these optimizations could be applied to rustc if a user/maintainer wants to build rustc on their own.

Here are the examples of PGO mentions in the documentation for other projects:

I didn't find a place where to put this information, so we can discuss it here. If there is no dedicated place and we don't want to create it - maybe a README would be a good place (since it already has build instructions)?

@zamazan4ik zamazan4ik added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Aug 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 26, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Aug 26, 2023

That's a good idea, this could potentially live in the rustc dev guide.

Some companies that build their own rustc (e.g. Google) are using their own setup, but it might still be worth it to document this for others that don't want to expend too much effort and get the PGO/BOLT benefits more easily.

It's worth noting that this will probably come with some maintenance cost to us. The PGO/BOLT setup is currently quite hardcoded for usage in our CI, and generalizing it for arbitrary rustc build environments might take some work (and further maintenance).

@zamazan4ik
Copy link
Contributor Author

It's worth noting that this will probably come with some maintenance cost to us. The PGO/BOLT setup is currently quite hardcoded for usage in our CI, and generalizing it for arbitrary rustc build environments might take some work (and further maintenance).

Good point. I think we can start with something with a lighter maintenance cost like it's described in the corresponding Clang docs about PGO. Later we will be able to provide additional UX improvements for building rustc with PGO e.g. with a friendly make pgoandboltbuild like it's done in GCC.

@saethlin saethlin added T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 26, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Sep 4, 2023

@Kobzol
Copy link
Contributor

Kobzol commented Sep 5, 2023

Do you consider this to be enough information for this issue to be closed? :)

@zamazan4ik
Copy link
Contributor Author

Yeah, that's perfect documentation! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants