Ruff author finds thin LTO for PGO instrumentation slashes Rust build times

charliermarsh · x · 2026-10-10

Charlie Marsh, author of Ruff, shares a build-optimization find: you can use thin LTO for the instrumented binary built during PGO, significantly reducing build time with seemingly no performance cost in the final binary.

His reasoning: PGO counters are based on function executions and control-flow paths and are inserted before LTO; inlined functions carry their counters along. Since thin and fat LTO share the same pre-link pipeline, both should produce equally useful profiling data — and his testing shows no meaningful difference.

Related event: Ruff Author Finds ThinLTO Dramatically Speeds Up PGO Builds(4 posts)→

Original post →

More from coding & agent

coding & agent channel →