build/docs/pgo.rst

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial