Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate using Profile-Guided Optimization (PGO) and Post Link Optimization (PLO) #3400

Open
zamazan4ik opened this issue Nov 15, 2023 · 2 comments

Comments

@zamazan4ik
Copy link

Hi!

Recently I checked Profile-Guided Optimization (PGO) improvements on multiple projects. The results are here. According to the multiple tests, PGO can help with improving performance in many cases. There is at least one performance report where Naga performed faster than glslang, and for Naga PGO effects can be checked here. Since this, I think PGO integration into the glslang would be a good thing to have.

I can suggest the following action points:

  • Perform PGO benchmarks on glslang. And if it shows improvements - add a note to the documentation about possible improvements in glslang performance with PGO.
  • Providing an easier way (e.g. a build option) to build scripts with PGO can be helpful for the end-users and maintainers since they will be able to optimize glslang according to their workloads.
  • Optimize pre-built binaries (if it's possible to do)

Maybe 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.

Here are some examples of how PGO optimization is integrated in other projects:

@arcady-lunarg
Copy link
Contributor

Better performance would definitely be nice to have, but I don't think PGO is going to get us a 30x speedup, for that we would probably need to do some actual profiling and look at algorithmic improvements.

@zamazan4ik
Copy link
Author

Better performance would definitely be nice to have, but I don't think PGO is going to get us a 30x speedup, for that we would probably need to do some actual profiling and look at algorithmic improvements.

Algorithmic improvements are always nice, of course. However, enabling PGO helps even for well-optimized algorithms. Like better hot/cold splits, better inlining, etc. - all these optimizations are helpful for algorithmically-optimized programs too.

How many improvements PGO can bring to glslang - it should be tested. As an estimation, right now I have only Naga benchmarks - more tests should be performed on glslang with PGO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants