Evaluate using Profile-Guided Optimization (PGO) and Post-Link Optimization (PLO) #109
zamazan4ik
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Thanks for sharing this! It's super detailed and informative. This is something that we can definitely look into promoting. I have some questions:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Recently I checked Profile-Guided Optimization (PGO) improvements on multiple projects. The results are available here. According to the tests, PGO can help with achieving better performance in many cases including compilers, parsers, log solutions, databases, etc. Since this, I think trying to optimize Zen performance with PGO can be a good idea to try.
I already did some benchmarks and want to share my results here.
Test environment
master
branch on commit6bd9c0138c6c514246f7dfe9ec389f97f42eeed6
Benchmark
For benchmark purposes, I use
cargo bench --workspace
. For PGO optimization I use cargo-pgo tool. The same benchmark suite was used for the PGO training phase built withcargo pgo bench -- --workspace
. PGO optimized results I got withcargo pgo optimize bench -- --workspace
.All measurements are done multiple times to check reproducibility - the results are stable across runs.
The only change to the codebase that was done is commenting this line due to Kobzol/cargo-pgo#44 . Not a big deal, honestly - it should not affect the benchmark results anyway.
Results
I got the following results:
At least in the benchmarks above, there are measurable improvements in many cases. However, there is a regression in the lexer scenario - it needs to be investigated further. One of the ideas why it's happening is that some noise from criterion-based benchmarks (it was previously discussed with other PGO people from the Rust community).
Further steps
I can suggest the following action points:
Testing Post-Link Optimization techniques (like LLVM BOLT) would be interesting too (Clang and Rustc already use BOLT as an addition to PGO) but I recommend starting from the usual PGO.
I would be happy to answer all your questions about PGO and PLO. I hope these benchmarks will be helpful.
Beta Was this translation helpful? Give feedback.
All reactions