Bun's Rust build wasn't 5x faster because of Rust—it was Full LTO

I made a build visualizer to understand Bun's compile times

Bun's Rust build wasn't 5x faster because of Rust—it was Full LTO

After seeing Jarred Sumner's claim that Bun's new Rust build was over 5x faster than the old Zig build on Linux, I built buildprof, an open-source tracing tool that records every process a build spawns and lays it on a timeline. Replaying both CI builds, I found the Zig build's 16-minute linker step was dominated by Full LTO, while Rust used ThinLTO. Switching Zig to ThinLTO and rebuilding WebKit with ThinLTO cut the link to 7m22s, but the real gap was that Rust's 90+ crates parallelize while Zig compiled as one module.

In my experience, Zig projects had usually compiled much faster than Rust projects of similar complexity. That intuition was enough to make me feel there was a mystery to solve.
  1. anaqin

    Good write up! I was hoping it was going to conclude with the author getting buns zig build way faster than Rusts but a good deep dive nevertheless

  2. t43562

    It's like Electric Insight, which was a fantastic if proprietary tool.

    There's an enormous amount of analysis you can do with tools like this from estimating how much faster the build would be with more cores (i.e. is it worth adding more) to things like a diff of one build against another: why is one build bad and the other good - what tasks had different parameters or weren't in both builds?

  3. dmpyatyi

    just a comment to support post :) Incredible work!!!

  4. jiehong

    Nice!

    What would the macOS equivalent be?

  5. quietraster

    build time visualizers always reveal something embarrassing in the graph. did the bun team engage with your findings, curious if the bottlenecks were known internally

More from this day

2026-09-12