3 ===========================
4 Profile Guided Optimization
5 ===========================
7 :abbr:`PGO (Profile Guided Optimization)` is the process of adding
8 probes to a compiled binary, running said binary, then using the
9 run-time information to *recompile* the binary to (hopefully) make it
15 The supported interface for invoking a PGO build is to evaluate the
16 *build* target of client.mk with *MOZ_PGO* defined. e.g.::
18 $ make -f client.mk MOZ_PGO=1
20 This is equivalent to::
22 $ make -f client.mk profiledbuild
24 Which is roughly equivalent to:
26 #. Perform a build with *MOZ_PROFILE_GENERATE=1* and *MOZ_PGO_INSTRUMENTED=1*
27 #. Package with *MOZ_PGO_INSTRUMENTED=1*
28 #. Performing a run of the instrumented binaries
29 #. $ make maybe_clobber_profiledbuild
30 #. Perform a build with *MOZ_PROFILE_USE=1*
32 Differences between toolchains
33 ==============================
35 There are some implementation differences depending on the compiler
38 The *maybe_clobber_profiledbuild* step gets its name because of a
39 difference. On Windows, this step merely moves some *.pgc* files around.
40 Using GCC or Clang, it is equivalent to a *make clean*.