On Wed, Dec 28, 2022, 00:37 Alexander Zaitsev wrote: > Hello. > > We are using GCC for our C++ projects. Our projects are huge, commit > rate is quite huge, so our CI workers are always busy (so as any other > CI workers, honestly). Since we want to increase build speed, one of the > option is to optimize the compiler itself. Sounds like a good case for PGO. > > Clang has the infrastructure for building the Clang itself with PGO: > https://llvm.org/docs/HowToBuildWithPGO.html . I have tried to find > something like that for GCC but with no success. > > My proposal is: > > * add support for building PGO-optimized GCC into the GCC build > infrastructure > * add documentation to the GCC site, how to build GCC with PGO > optimizations > * (if GCC community provides prebuilt gcc binaries) use PGO for the > prebuilt binaries. E.g. Clang and rustc already uses this approach. > > Any feedback is appreciated. > > Thanks in advance! > > -- > Best regards, > Alexander Zaitsev > I would wager that you would get more bang for your buck out of 1) building a more recent gcc yourself instead of using whatever comes packaged, and 2) building with march=native for each processor type you run on. Not that PGO won't help, of course it will since you are building the same software repeatedly, but my personal experience doing the exact same thing is that I saw a 50% performance improvement from just from that, and it's rather trivial to do if your infrastructure is homogeneous (mine was a many node compute cluster). The next biggest bottleneck for me was IO, because the project this was for when compiling was very file intensive. Anyway, just some alternative suggestions, since there's already a response giving you what you asked for. Feel free to ignore me :) >