pgo.rst 1.2 KB

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