~/talk

How Rust Compiles - Noratrieb

Talkat EuroRust 2025 · 2025-10-09..10-10· [rust]
slides:none on file

Shows that Rust compiles by turning Rust into MIR then into LLVM IR where monomorphization and inlining happen, explains why generics create duplicate instantiations and how #[inline] delays codegen (its use hides a post‑monomorphization array‑size error in the library example), demonstrates measuring duplicates with cargo‑llvm‑lines, compares LTO modes (fat LTO slows clean builds ~2–4× but can speed runtime, thin LTO gives similar runtime with parallelism), and lists linkers (LLD, mold, wild) and the object/AR/link step that actually produces the binary.

AI-written summary · about

  1. 0:00Rust compilation intro
  2. 1:30Rust speed focus
  3. 2:33Compiler phases and MIR
  4. 4:40Slow back end in Rust
  5. 6:07Codegen units and parallelism
  6. 7:50Linker optimizations
  7. 9:59Splitting code into units
  8. 10:20Generics and monomorphization
  9. 13:09Inlining trade-offs
  10. 15:57Lazy instantiation with inline
  11. 17:02Link time optimization
  12. 18:27Fat vs thin LTO
  13. 20:31Plugin LTO and cross-language
  14. 21:54Thin local LTO
  15. 22:15Inlining for runtime
  16. 23:18Reducing compile times
  17. 24:02Balancing compile vs runtime
  18. 24:43Inline attribute error
~/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.