What Is Link-Time Optimization?
Link-time optimization, or LTO, is a compiler technique that postpones some optimization to the linking stage so the toolchain can see the whole program rather than one file at a time. This enables cross-module inlining and dead-code elimination that per-file compilation cannot do. The result is often a faster, smaller binary.
Why it matters
Optimizing each translation unit in isolation misses opportunities that only appear when the whole program is visible, and LTO recovers them. The cost is a heavier, slower link step that can dominate build time. Teams often enable full LTO only for release builds and keep CI builds lighter to protect build minutes.
Related guides
What Is Incremental Linking?Incremental linking updates only the changed parts of an existing executable instead of relinking the whole b…
What Is a Compiler Cache?A compiler cache stores the output of compiling a translation unit keyed on its inputs, so an identical compi…
What Is Build Reproducibility?Build reproducibility is the property that building the same source in the same environment yields a bit-for-…