encyclopegia.org

Profile-guided optimization

In computer programming, profile-guided optimization (PGO, sometimes pronounced as pogo ), also known as profile-directed feedback (PDF) or feedback-directed optimization (FDO), is the compiler optimization technique of using prior analyses of software artifacts or behaviors ("profiling") to improve the expected runtime performance of the program.[src]

In computer programming, profile-guided optimization (PGO, sometimes pronounced as pogo ), also known as profile-directed feedback (PDF) or feedback-directed optimization (FDO), is the compiler optimization technique of using prior analyses of software artifacts or behaviors ("profiling") to improve the expected runtime performance of the program.[src] ==Method== Optimization techniques based on static program analysis of the source code consider code performance improvements without actually executing the program.[src] No dynamic program analysis is performed.[src] For example, inferring or placing formal constraints on the number of iterations a loop is likely to execute is fundamentally useful when considering whether to unroll it or not, but such facts typically rely on complex runtime factors that are difficult to conclusively establish.[src] Usually, static analysis will have incomplete information and only be able to approximate estimates of the eventual runtime conditions.[src] The first high-level compiler, introduced as the Fortran Automatic Coding System in 1957, broke the code into blocks and devised a table of the frequency each block is executed via a simulated execution of the code in a Monte Carlo fashion in which the outcome of conditional transfers (as via IF -type statements) is determined by a random number generator suitably weighted by whatever FREQUENCY statements were provided by the programmer.[src] Rather than programmer-supplied frequency information, profile-guided optimization uses the results of profiling test runs of the instrumented program to optimize the final generated code.[src] The compiler accesses profile data from a sample run of the program across a representative input set.[src] The results indicate which areas of the program are executed more frequently, and which areas are executed less frequently.[src] All optimizations benefit from profile-guided feedback because they are less reliant on heuristics when making compilation decisions.[src] 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.[src] Just-in-time compilation can make use of runtime information to dynamically recompile parts of the executed code to generate more efficient native code.[src] If the dynamic profile changes during execution, it can deoptimize the previous native code, and generate a new code optimized with the information from the new profile.[src] ==Adoption== There is support for building Firefox using PGO.[src] Even though PGO is effective, it has not been widely adopted by software projects, due to its tedious dual-compilation model.[src] It is also possible to perform PGO without instrumentation by collecting a profile using hardware performance counters.[src] This sampling-based approach has a much lower overhead and does not require a special compilation.[src] The HotSpot Java virtual machine (JVM) uses profile-guided optimization to dynamically generate native code.[src] As a consequence, a software binary is optimized for the actual load it is receiving.[src] If the load changes, adaptive optimization can dynamically recompile the running software to optimize it for the new load.[src] This means that all software executed on the HotSpot JVM effectively make use of profile-guided optimization.[src] PGO was introduced in the Microsoft Visual C++ (MSVC) compiler with the release of Visual Studio 2005.[src] PGO has been adopted in the Microsoft Windows version of Google Chrome.[src] PGO was enabled in the 64-bit edition of Chrome starting with version 53 and version 54 for the 32-bit edition.[src] Google published a paper describing a tool in use for using production profiles to guide builds resulting in up to a 10% performance improvement.[src] ==Implementations== Examples of compilers that implement PGO are: Intel C++ Compiler and Fortran compilers GNU Compiler Collection compilers (commonly called GCC) Oracle Solaris Studio (formerly called Sun Studio) Microsoft Visual C++ compiler Clang IBM XL C/C++ GraalVM Enterprise Edition .NET JIT compiler Go Rust ==See also== Adaptive optimization Dynamic dead code elimination Global optimization Hot spot (computer programming) Interprocedural optimization Link-time optimization (LTO) Tracing just-in-time compilation ==References==[src]

27 sentences · 27 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Profile-guided optimization." encyclopegia.org, 2026, https://encyclopegia.org/wiki/profile-guided-optimization. Accessed 26 November 2026.

Chicago

"Profile-guided optimization." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/profile-guided-optimization.

APA

encyclopegia.org. (2026). Profile-guided optimization. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/profile-guided-optimization

Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

mathematical optimization

stub · references available

Profile

stub · references available

Protection Profile

stub · references available

rate–distortion optimization

stub · references available

The Guided Fate Paradox

stub · references available

Low-profile Quad Flat Package

stub · references available

Profile

stub · references available

guided missile cruiser

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1363219122 · 0.5 · snapshot enwiki-001363219122

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.