~/talk

How To Compile Rust Code Faster: Compiler 101

Talkat Rust in Paris 2025 · on Wednesday, 2025-06-25· [rust, compilers-and-language-design]
links:none on file
slides:none on file

A 200k‑line Rust library has a 66s cold debug build; experiments target the front end and link stage for wins. Self‑profiling pinpoints slow type‑checking in an async_trait→BoxFuture use that drops ~7s when replaced. Enabling front‑end threading to eight threads trims ~30% (66s→45s). Trying Cranelift cuts ~4s for workspace crates. Tools used include cargo-llvm-lines to spot duplicated monomorphizations, cargo-udeps, and faster linkers like mold and wild (≈3s saved).

AI-written summary · about

  1. 0:00Introduction and background
  2. 3:36What are compile times
  3. 5:23Why Rust compiles slowly
  4. 9:17Benchmark setup and project overview
  5. 10:22Compiler phases and IRs
  6. 14:57Sources of large IR generation
  7. 17:02Inlining and its trade-offs
  8. 20:52Generics and monomorphization
  9. 22:36Shared generics feature
  10. 24:24Parallel compilation with Z threads
  11. 25:47Optimization passes overview
  12. 27:55LLVM backend and alternatives
  13. 29:03Cranelift experiment
  14. 31:08Self-profile analysis tool
  15. 34:21Async trait pathological case
  16. 37:08Cargo pipeline and linking
  17. 38:34Splitting code into crates
  18. 39:19Dependency optimization tips
  19. 41:27Linkers and LTO options
  20. 42:10Alternate linkers comparison
  21. 43:33Dynamic libraries and future work
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.