MarketProfile-guided optimization
Company Profile

Profile-guided optimization

In computer programming, profile-guided optimization, 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.

Method
Optimization techniques based on static program analysis of the source code consider code performance improvements without actually executing the program. No dynamic program analysis is performed. 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. Usually, static analysis will have incomplete information and only be able to approximate estimates of the eventual runtime conditions. 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. 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. {{cite web Just-in-time compilation can make use of runtime information to dynamically recompile parts of the executed code to generate more efficient native code. 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. ==Adoption==
Adoption
There is support for building Firefox using PGO. Even though PGO is effective, it has not been widely adopted by software projects, due to its tedious dual-compilation model. This sampling-based approach has a much lower overhead and does not require a special compilation. The HotSpot Java virtual machine (JVM) uses profile-guided optimization to dynamically generate native code. As a consequence, a software binary is optimized for the actual load it is receiving. If the load changes, adaptive optimization can dynamically recompile the running software to optimize it for the new load. This means that all software executed on the HotSpot JVM effectively make use of profile-guided optimization. PGO was introduced in the Microsoft Visual C++ (MSVC) compiler with the release of Visual Studio 2005. PGO has been adopted in the Microsoft Windows version of Google Chrome. PGO was enabled in the 64-bit edition of Chrome starting with version 53 and version 54 for the 32-bit edition. Google published a paper describing a tool in use for using production profiles to guide builds resulting in up to a 10% performance improvement. ==Implementations==
Implementations
Examples of compilers that implement PGO are: • Intel C++ Compiler and Fortran compilers • ClangIBM XL C/C++GraalVM Enterprise Edition • .NET JIT compiler • GoRust ==See also==
tickerdossier.comtickerdossier.substack.com