Profile-guided optimization

From Wikipedia, the free encyclopedia

Profile-guided optimization (PGO) (sometimes pronounced as pogo,[1] also known as profile-directed feedback PDF[2]) is a compiler optimization technique in computer programming that uses profiling to improve program runtime performance.

Method

In contrast to traditional optimization techniques that solely use the source code, PGO uses the results of profiling test runs of the instrumented program to optimize the final generated code.[3][4] 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.

Adoption

There is support for building Firefox using PGO.[5] Even though PGO is effective, it has not been widely adopted by software projects, due to its tedious dual-compilation model.[6] It is also possible to perform PGO without instrumentation by collecting a profile using hardware performance counters.[6] This sampling-based approach has a much lower overhead and does not require a special compilation.

Implementations

Examples of compilers that implement PGO are:

See also

References

This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.