Skip to content

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

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

Open
zamazan4ik opened this issue May 27, 2025 · 1 comment

Comments

@zamazan4ik
Copy link

Hi!

Let's try to apply even more optimizations after enabling LTO ;) I checked Profile-Guided Optimization (PGO) CPU performance improvements on multiple projects (including many databases like PostgreSQL and network proxies like Envoy, HAProxy, Nginx, etc.) - the results are available in the awesome-pgo repo. Since the pgdog project cares about its performance - it could an interesting opportunity to use PGO.

I can suggest the following things to do:

  • We need to perform PGO benchmarks on pgdog. If it shows improvements - add a note about possible improvements to the documentation. Providing an easier way (e.g. a build option) to build scripts to build pgdog with PGO can be useful for the end-users too.
  • It will be a good idea to integrate building with PGO into your CI pipelines. In this case, users will get already PGO-optimized binaries from the website (when will they be available for the users, of course).

Here you can find different materials about PGO: many benchmarks for different apps, examples of how PGO is already integrated with various projects, and some PGO-related pieces of advice. For Rust-based applications, I recommend starting with cargo-pgo.

After PGO, I suggest evaluating the Post-Link Optimization (with tools like LLVM BOLT) - it can give more aggressive optimizations even after PGO. However, starting with regular PGO will be easier to do.

Thank you.

@levkk
Copy link
Collaborator

levkk commented May 27, 2025

Worth a shot. The flamegraph currently is reasonably clean (I'm using samply), but I'm definitely open to some "free" optimizations from the linker.

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

No branches or pull requests

2 participants