Profile-Guided Optimization (PGO)

Profile-guided Optimization (PGO) improves application performance by re-ordering code layout to reduce instruction-cache problems, shrinking code size, and reducing branch mispredictions. PGO provides information to the compiler about areas of an application that are most frequently executed so the compiler is able to be more selective and specific in optimizing the application.

PGO consists of three phases or steps:

  1. Instrument the program: build the program using the compiler flag -prof-gen or /Qprof-gen
  2. Run the instrumented executable to gather profiling data with various input data or workloads
  3. Re-build the program with the profiling data using flag -prof-use or /Qprof-use

See Profile-Guided Optimizations Overview section in the User and Reference Guide for some useful information about PGO.

  • Profile-guided optimization (PGO) samples
  • Click on the sample name to see an in-depth description and source code.
    Sample Name Program Domain/Area Description Target Platforms OSes
    Fluid Animate with Profile Guided Optimization (PGO) Computational Fluid Dynamics Simulate the flow of fluid in a container using the Smoothed-Particle Hydrodynamics model.
    Usage of Intel® C++ compiler PGO optimization
    Usage of Intel® Cilk™ Plus: Array Notation
    Desktop Windows*; Linux*; OS X*

Please check back frequently as more samples will be added in the future.

For more complete information about compiler optimizations, see our Optimization Notice.