Share via


/GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)

 

The latest version of this topic can be found at -GENPROFILE, -FASTGENPROFILE (Generate Profiling Instrumented Build).

Specifies generation of a .pgd file by the linker to support profile-guided optimization (PGO). /GENPROFILE and /FASTGENPROFILE use different default parameters. Use /GENPROFILE to favor precision over speed and memory usage during profiling. Use /FASTGENPROFILE to favor smaller memory usage and speed over precision.

Syntax

/{GENPROFILE|FASTGENPROFILE}[:{COUNTER32|COUNTER64|EXACT|MEMMAX=#|MEMMIN=#|NOEXACT|NOPATH|NOTRACKEH|PATH|PGD=filename|TRACKEH}]   

Remarks

COUNTER32 | COUNTER64
Use COUNTER32 to specify the use of 32-bit probe counters, and COUNTER64 to specify 64-bit probe counters. When you specify /GENPROFILE, the default is COUNTER64. When you specify /FASTGENPROFILE, the default is COUNTER32.

EXACT | NOEXACT
Use EXACT to specify thread-safe interlocked increments for probes. NOEXACT specifies unprotected increment operations for probes. The default is NOEXACT.

MEMMAX=value, MEMMIN=value
Use MEMMAX and MEMMIN to specify the maximum and minimum reservation sizes for training data in memory. The value is the amount of memory to reserve in bytes. By default, these values are determined by an internal heuristic.

PATH | NOPATH
Use PATH to specify a separate set of PGO counters for each unique path to a function. Use NOPATH to specify only one set of counters for each function. When you specify /GENPROFILE, the default is PATH. When you specify /FASTGENPROFILE, the default is NOPATH.

TRACKEH | NOTRACKEH
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use TRACKEH to specify extra counters for an exact count. Use NOTRACKEH to specify single counters for code that does not use exception handling or that does not encounter exceptions in your training scenarios. When you specify /GENPROFILE, the default is TRACKEH. When you specify /FASTGENPROFILE, the default is NOTRACKEH.

PGD=filename
Specifies a base file name for the .pgd file. By default, the linker uses the base executable image file name with a .pgd extension.

The /GENPROFILE and /FASTGENPROFILE options tell the linker to generate the profiling instrumentation file needed to support application training for profile-guided optimization (PGO). The profiling information generated by application training is used as input to perform targeted whole-program optimizations during builds. You can set additional options to control various profiling features for performance during app training and builds. The default options specified by /GENPROFILE give most accurate results, especially for large, complex multi-threaded apps. The /FASTGENPROFILE option uses different defaults for a lower memory footprint and faster performance during training, at the expense of accuracy.

Profiling information is captured when you run the instrumented app after you build by using /GENPROFILE of /FASTGENPROFILE. This information is used by the linker when you specify the /USEPROFILE option. For more information on how to train your app and details on the collected data, see Profile Guided Optimization.

You must also specify /LTCG when you specify /GENPROFILE or /FASTGENPROFILE.

See Also

Setting Linker Options
Linker Options
/LTCG (Link-time Code Generation)