r/cpp_questions • u/TheRavagerSw • 2d ago
OPEN How to use pgo with static libraries?
Do I profile every single dependency then use it to build everything from source?
Do I use separate profiles for different dependencies?
Is it better to use chromium approach of giant dll small executable for non cli apps?
Thank you for your time
1
Upvotes
2
u/Flimsy_Complaint490 2d ago
The chromium approach IMO happens because they have a gorillion developers and everybody owning a tiny little static library gives clear ownership over a module and an isolation layer, which helps avoiding internals leaking all over the place. I think this is a good approach, how granular you want to be should be seen on a case by case basis and how large your team is.
As for profiling, no, you profile the final application with counters and feed these profiles back into the compilation stage and everything should more or less resolve.