Tracing every process a build launches turns “the build is slow” into a diagram. Lalit Maganti built buildprof to settle one question: why Bun’s Linux CI build ran ~30 minutes in the Zig era and ~5m40s in the Rust era, and how much of the celebrated >5× speedup was actually the language.
He reproduced the numbers on a 6-core VM (24m24s versus 5m40s), then let the trace answer it:
- In the Zig build a single
ld.lldinvocation ran alone at the end for 16m35s — two-thirds of the build — and LLD’s ownOptModulephase accounted for more than ten minutes of that - The Zig build used Full LTO; the Rust build used ThinLTO, a detail mentioned only in passing in the original claim
- Switching just Bun’s own Zig code to ThinLTO: 20m20s. Still slow, because WebKit and ICU arrive as prebuilt static libraries compiled with Full LTO — rebuilding those too brought the build to 15m11s
- The gap that remained was structural, not linguistic: Rust compiles more than 90 crates in parallel, while the Zig build funnelled everything through one module, and dependency arrows showed the linker waiting on a single
bun-zig.owhile the C++ side had long finished
The tool design is worth copying. Builds are process trees, so recording fork/exec with ptrace — plus a seccomp filter for file events — covers Cargo, Ninja, Make, Zig and the arbitrary scripts wrapped around them, with no per-build-system integration. Overhead is small (ripgrep 12.27s → 12.43s, Redis 26.78s → 31.89s), and --no-file-events trades file detail for speed.
He also checked whether this already existed: ninjatracing only sees Ninja’s log, Cargo timings covered 1m51s of a 5m40s build, -ftime-trace stops at the compiler invocation, and strace gives general process events rather than a build-shaped view.
The takeaway is that headline performance claims decompose under measurement. What looked like a language win was mostly a linker flag on a downloaded dependency plus one giant compilation unit — and the next time a slow build annoys him, he now has the tool to see exactly which of those it is.