Profile-Guided Optimization (PGO) benchmark report #166
zamazan4ik
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Note that if you're benchmarking musli, you should not be using As for PGO, it's unclear to me how to translate benchmarking outcomes into concrete improvements without significant effort. If you do have more concrete guidance on this, for example what the full workflow of implementing an improvement looks like it would be appreciated. |
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!
I was interested in optimizing the library's performance even further. I evaluated Profile-Guided Optimization (PGO) on many projects - all the results are available at https://github.com/zamazan4ik/awesome-pgo . Since this compiler optimization works well in many places, especially different parsers, I decided to apply it to the project - here are my benchmark results.
Test environment
musli
version:main
branch on commitaf9cd871af456e1b56eea5ca0d7d5112bb1c9c27
Benchmark
For benchmark purposes, I use built-in into the project benchmarks. For PGO optimization I use cargo-pgo tool. Release bench result I got with
taskset -c 0 cargo bench --workspace --all-features
command. The PGO training phase is done withtaskset -c 0 cargo pgo bench -- --workspace --all-features
, PGO optimization phase - withtaskset -c 0 cargo pgo optimize bench -- --workspace --all-features
.taskset -c 0
is used for reducing the OS scheduler influence on the results. All measurements are done on the same machine, with the same background "noise" (as much as I can guarantee).Results
I got the following results:
According to the results, PGO measurably improves the library's performance in many cases.
Further steps
I can suggest the following action points:
I would be happy to answer your questions about PGO.
Beta Was this translation helpful? Give feedback.
All reactions