profileguided
ProfileGuided, commonly referred to as profile-guided optimization (PGO), is a compiler optimization technique that uses runtime profiling data to guide optimization decisions. By profiling a representative workload, the compiler can tailor generated code to real execution patterns, improving performance on hot paths and reducing unnecessary work on less frequently executed code.
Profiling data is collected either through instrumentation, which records exact counts of how often functions and
Typical optimizations guided by profile data include inlining decisions, function layout and code density to improve
Limitations include the need for representative profiling data, potential growth in build times and complexity, and
PGO is supported by major compilers such as GCC and LLVM/Clang, and by Microsoft Visual C++. It