Evaluate additional optimizations like LTO, PGO, PLO #431
zamazan4ik
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
In this discussion, I want to propose several ideas about how the project's performance can be improved.
I noticed that in the
Cargo.toml
file Link-Time Optimization (LTO) for the project is not enabled. I suggest switching it on since it will reduce the binary size (always a good thing to have) and will likely improve the application's performance a bit (in this case, it's not critical at all but anyway).I suggest enabling LTO only for the Release builds so as not to sacrifice the developers' experience while working on the project since LTO consumes an additional amount of time to finish the compilation routine. If you think that a regular Release build should not be affected by such a change as well, then I suggest adding an additional
dist
orrelease-lto
profile where additionally to regularrelease
optimizations LTO also will be added. Such a change simplifies life for maintainers and others interested in the project persons who want to build the most performant version of the application. Using ThinLTO also should help. If we enable it on the Cargo profile level, users, who install the application withcargo install
, will get the LTO-optimized version "automatically".Another thing - PGO. Recently I did many Profile-Guided Optimization (PGO) benchmarks on multiple projects (including many compilers and compiler-like workloads like static analyzers, code formatters, etc.) - the results are available here. I think such optimization can be useful for Whitebox too.
I suggest evaluating PGO applicability to Whitebox tools. If it helps to achieve better performance - add a note to the documentation about that. In this case, users and maintainers will be aware of another optimization opportunity for Whitebox tools. Also, PGO integration into the build scripts can help users and maintainers easily apply PGO to their workloads. Even distributed by Whitebox prebuilt binaries (like Python wheel) can be pre-optimized with PGO on a generic-enough sample workload (e.g.
rustc
already does it).After PGO, I can suggest evaluating LLVM BOLT as an additional optimization step.
For the Rust projects, I recommend starting with cargo-pgo - it makes PGO optimization easier in many cases.
I would be happy to answer all your questions about LTO, PGO, and PLO!
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions