Zig Builds Are Getting Faster Date: October 3, 2025 Author: Mitchell Hashimoto --- Overview Andrew Kelley, creator of Zig, famously noted: "The compiler is too damn slow, that's why we have bugs." With this in mind, a primary goal of the Zig language for years has been achieving faster compilation times. The Zig team has tackled this challenge by: Moving away from LLVM (e.g., "yeeting LLVM") Creating their own code generation backends Developing custom linkers Progressing towards incremental compilation After multi-year efforts, significant improvements are observable in Zig 0.15.1, demonstrated by real-world build times from the Ghostty project. --- Build Performance Comparisons (Zig 0.14 vs 0.15.x) Build Script Compilation (build.zig) Zig 0.14: 7.167 seconds Zig 0.15: 1.702 seconds This is the time required to build the build script itself, impacting the initial build time when no caches exist. --- Full Uncached Ghostty Binary Build Zig 0.14: 41 seconds Zig 0.15: 32 seconds Includes build script compilation. Indicates about a 9-second real-world speedup in full initial builds. Note: Most of this still uses LLVM, as the self-hosted x8664 backend is not yet bug-free. Once fully transitioned, build times may drop further to ~25 seconds or less. --- Incremental Build (Ghostty Executable) Zig 0.14: 19 seconds Zig 0.15: 16 seconds Measured after a small change in terminal emulation code. This rebuild still recompiles considerable code because incremental compilation is not fully functional yet. Expect further reductions to around 12 seconds without LLVM and eventually to milliseconds with complete incremental compilation. --- Incremental Build (libghostty-vt) Zig 0.14: 2.884 seconds Zig 0.15: 0.975 seconds This library builds fully with the self-hosted backend (no LLVM). The sub-second build time shows the backend's maturity and hints at what faster workflows can achieve soon. The author notes a drastic workflow improvement, staying focused in terminal rather than tabbing away during long builds. --- Summary and Future Prospects Zig 0.15.1 provides faster builds across all scenarios—even without complete incremental compilation or full backend transitions. The self-hosted x8664 backend is stable enough for debug builds, and the aarch64 backend is progressing. Full transition away from LLVM and functional incremental compilation are expected to dramatically enhance build speed, with incremental rebuilds potentially reaching millisecond times. The author is highly optimistic about Zig's trajectory and encouraged by the impact on Ghostty's development productivity. --- Footnotes Andrew Kelley's quote timestamped here. A massive amount of work underpins these improvements beyond just LLVM replacement. Measurements were taken on the same x8664 Linux machine for consistency. --- Contact & Social Links:** Email: m@mitchellh.com Twitter: @mitchellh Mastodon: @mitchellh@hachyderm.io GitHub: mitchellh LinkedIn: Mitchell Hashimoto