~/talk

How Profile-Guided Optimization Makes Your Code Faster Without Any Code Changes

Talkat C++ on Sea 2021 · 2021-06-30..07-02· [c-and-cpp]
links:none on file
slides:none on file

Profile-guided optimization with GCC compiles once with -fprofile-generate, runs representative workloads to produce main.gca, then recompiles with -fprofile-use to change code layout and inlining decisions. Measured with perf counters, hot/cold function splitting and call reordering cut L1 instruction-cache misses from ~6M to ~1.5M and cut a microbenchmark from 0.206s to 0.17s; devirtualization inlines the common virtual case. Chrome reports ~10% faster page loads and Clang shows ~20% faster builds when built with PGO.

AI-written summary · about

  1. 0:00Start
  2. 1:59Problem - Missed Compiler Optimizations
  3. 3:25Profile Guided Optimization (PGO)
  4. 4:57How to use PGO
  5. 6:18Training
  6. 32:53Virtual Tables
  7. 41:47Missing profile data
  8. 44:06Excluding Functions - Attributes
  9. 44:16Untrainable Functions
  10. 45:48Sources & Further Material
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.