Hi!
I am investigating the Profile-Guided Optimization (PGO) state across the ecosystem - all my current results (with a lot of benchmarks, PGO-related information, and much more) are available at https://github.com/zamazan4ik/awesome-pgo . I am interested in PGO state in the D ecosystem too - that's why I am here.
I had been researching a little about PGO in D but compared to C++ almost no information is available in the official documentation (or I just don't know where to search it, hah). I have the following questions (for each D compiler: DMD, GDC, LDC - am interested in all of them):
- What is the most up-to-date place for PGO documentation? Right now I found only this for LDC. What about DMD and GDC?
- Does any D compiler support Sampling PGO (also known as AutoFDO)? If Sampling PGO is not supported - do you plan to support it in the future? For us sampling PGO can be important since it's much easier to use for gathering the PGO profiles directly from the production environment without hurting the production performance a lot.
- Do you support other PGO modes like CSIR PGO in D compilers? If not, do you plan to support them in the future?
- What performance improvements did you get with enabling LTO + PGO on D compilers? Could you please share the number for each compiler? With this information it's much easier to consider rebuilding a D compiler (due to strict security requirements) locally with PGO since we can estimate benefits from PGO for the D compiler based on the actual benchmarks from the compiler developers.
- Is there any documentation on how to build DMD and GDC with LTO+PGO? I am looking for smth like it's done in the ClickHouse documentation (or like it's done for Clang or Rustc).
- Am I right that the officially released D compiler binaries are already LTO + PGO optimized? According to the script it's true at least for LDC. What about other compilers?
Similar questions about LDC in the upstream: https://github.com/ldc-developers/ldc/discussions/4524
Thanks a lot for the help!