Profile-Guided Optimization (PGO) benchmarks #2625
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!
Recently I checked optimizations like Profile-Guided Optimization (PGO) and Post-Link Optimizations (PLO) improvements on multiple projects. The results are available here. According to the tests, all these optimizations can help with achieving better performance in many cases for many applications including many network-related applications like Envoy and HAProxy. That's why I decided to test PGO on axum too.
I already did some benchmarks and want to share my results here. Hopefully, they will be helpful.
Test environment
main
branch on commitb03f6c1184723bdc079215222fc168ef96847dea
Benchmark
For benchmark, I use
cargo bench
command. PGO training phase -cargo pgo bench
, PGO optimization -cargo pgo optimize bench
. Benchmarks are done in two modes: singe-threaded and multi-threaded. Single-threaded benchmarks are done with the same command withtaskset -c 0
addition.All PGO optimizations are done with cargo-pgo.
All measurements are done multiple times - the results are consistent enough across runs.
Results
I got the following results:
According to the results, PGO shows measurable improvement in the benchmark.
Further steps
I can recommend at least mentioning PGO somewhere in the documentation as a possible way to improve Axum's performance. Also, I can suggest continuing to test more advanced optimizations with tools like LLVM BOLT (for PLO).
I would be happy to answer questions about PGO!
Beta Was this translation helpful? Give feedback.
All reactions