3 ms·
PGO detects hot/cold functions and places them together¹ ², but I imagine whatever it needs on startup is probably not especially hot. …Though it might all be c
by PeCaN 7y ago
PGO detects hot/cold functions and places them together¹ ², but I imagine whatever it needs on startup is probably not especially hot. …Though it might all be cold, which would have the same effect, actually.
―
¹ At least on GCC but I would be very surprised if clang doesn't also do this.
² You can also do this manually with __attribute__((hot)) and __attribute__((cold))
- the8472 7y agoPGO may not be the right tool for this. Mozilla used custom instrumentation and linker scripts to achieve symbol ordering optimized for startup. https://web.archive.org/web/20100223202038/http://blog.mozilla.com/tglek/2010/02/19/teaching-ld-to-optimize-binaries-for-startup/ https://web.archive.org/web/20100223202038/http://blog.mozil...