Profile-guided optimization (PGO, sometimes pronounced as “pogo”) is a compiler optimization technique in computer programming to improve program runtime performance. In contrast to traditional optimization techniques that solely use the source code, PGO uses the results of test runs of the instrumented program to optimize the final generated code. The compiler is used to access data from a sample run of the program across a representative input set. The data indicates which areas of the program are executed more frequently, and which areas are executed less frequently. All optimizations benefit from profile-guided feedback because they are less reliant on heuristics when making compilation decisions. The caveat, however, is that the sample of data fed to the program during the profiling stage must be statistically representative of the typical usage scenarios; otherwise, profile-guided feedback has the potential to harm the overall performance of the final build instead of improving it.
Even if PGO proved very effective, it has not been widely adopted by software projects, due to its tedious dual-compilation model. It is also possible to perform PGO without instrumentation by collecting a profile using Hardware Performance Counters. This sampling-based approach has a much lower overhead and does not require a special compilation.
Examples of compilers that implement PGO are:
- Intel C++ Compiler and Fortran compilers,
- GNU Compiler Collection compilers
- Oracle Solaris Studio (formerly called Sun Studio)
- Microsoft Visual C++ compiler
- "Microsoft Visual C++ Team Blog".
- Optimization "Intel Fortran Compiler 10.1, Professional and Standard Editions, for Mac OS X".
- "Profile-Guided Optimization (PGO) Quick Reference".
- Dehao Chen (2010). "Taming hardware event samples for fdo compilation", Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimization, pp. 42–52.
|This programming tool–related article is a stub. You can help Wikipedia by expanding it.|