Profilingguided
Profilingguided, in practice usually referred to as profiling-guided optimization (PGO), is a software optimization technique that uses runtime profiling data to steer compiler decisions during recompilation. The core idea is to tailor generated code to the actual execution characteristics of a workload, rather than relying solely on static analysis.
How it works typically involves a two-phase workflow. First, an instrumented or sampling build collects profile
PGO is supported by major compiler projects and toolchains. For example, GCC offers -fprofile-generate and -fprofile-use
Advantages of profiling-guided optimization include potential speedups, improved cache efficiency, and better instruction caches due to