Evaluate using Profile-Guided Optimization (PGO) in the future #4
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
It's not an actual problem - just a possible improvement idea for the project. I created the Issue since Discussions are disabled for the repo.
I decided to test the Profile-Guided Optimization (PGO) technique to optimize Fennec's performance. For reference, results for other projects are available at https://github.com/zamazan4ik/awesome-pgo . Since PGO helped with many projects (including compilers, code formatters, language servers, linters, etc.), I decided to apply it to Fennec to see if the performance win (or loss) can be achieved. Here are my benchmark results.
Test environment
fennec
version:main
branch on commit636ebde54be22d52413cef7bfcb05e59127fb31e
Benchmark
For benchmark purposes, I use
fennec lint
command for linting PHP-CS-Fixer. For PGO optimization I use cargo-pgo tool. The PGO training workload is the same -fennec lint
on thePHP-CS-Fixer
project with the PGO instrumentedfennec
(is done withcargo pgo build
).taskset -c 0
is used to reduce the OS scheduler's influence on the results. All measurements are done on the same machine, with the same background "noise" (as much as I can guarantee) and multiple times withhyperfine
.Results
I got the following results.
where:
fennec_release
: the default Release profilefennec_optimized
: the default Release profile + PGO optimizationAccording to the results, we see measurable performance improvement.
Further steps
I can suggest the following action points:
awesome-pgo
results, such tools also can be performance-improved with PGOAlso, Post-Link Optimization (PLO) can be tested after PGO. It can be done by applying tools like LLVM BOLT. However, it's a much less mature optimization technique compared to PGO.
Since the project is in its early stages, for now, I recommend you don't spend much time on integrating PGO into the project pipelines. But when most of the features are implemented, then PGO will be a good addition for the project
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions