~/talk

Optimizing compilation times with Templates

links:none on file
slides:none on file

Facebook’s Thrift RPC code generates huge per-field serializers so template instantiation dominates build time; measuring with -ftime-report and the Templight tracer shows one template taking 60s of a 350s front end (≈20%) and overall slowest unit dropping from ~800s to ~400s (~50%). Fix replaces repeated generated code with a generic templated library using type-tagging (swap SFINAE enable_if for constant-time tags), reducing instantiation time by an order of magnitude and improving runtime serialization ~5%.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:03Template compilation myths
  3. 3:10How template instantiation works
  4. 7:25Measuring compile times
  5. 11:22Thrift framework overview
  6. 12:24Identifying template bottlenecks
  7. 15:20Optimization hypothesis
  8. 16:24First optimization attempt
  9. 17:52Type tagging solution
  10. 19:20Results and improvements
  11. 21:36Why optimize compilation times
  12. 22:44Q&A session
~/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.