Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GCC supports the hot and cold attributes so you can manually instruct the compiler how to arrange compilation sections. They basically set the PGO counts to +/- infinity for those functions.

While nowhere near as nice as real profile guided optimization (and likely to grow stale over time), these attributes are much easier to insert compared to fighting with whatever build toolchain you’re using.



cold functions are also optimised at -Os.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: