|
1 .. _pgo: |
|
2 |
|
3 =========================== |
|
4 Profile Guided Optimization |
|
5 =========================== |
|
6 |
|
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 |
|
10 faster. |
|
11 |
|
12 How PGO Builds Work |
|
13 =================== |
|
14 |
|
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.:: |
|
17 |
|
18 $ make -f client.mk MOZ_PGO=1 |
|
19 |
|
20 This is equivalent to:: |
|
21 |
|
22 $ make -f client.mk profiledbuild |
|
23 |
|
24 Which is roughly equivalent to: |
|
25 |
|
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* |
|
31 |
|
32 Differences between toolchains |
|
33 ============================== |
|
34 |
|
35 There are some implementation differences depending on the compiler |
|
36 toolchain being used. |
|
37 |
|
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*. |