Zig Builds Are Getting Faster

https://news.ycombinator.com/rss Hits: 26
Summary

Andrew Kelley famously (or infamously, depending on your views) said "the compiler is too damn slow, that's why we have bugs."1 As a result, one of the primary stated goals of Zig for years has been faster compile times. The Zig team has been working on extremely hard problems to make this a reality (such as yeeting LLVM, writing their own code generation backends, building their own linkers, and marching towards incremental compilation in general).2 The fruits of this multi-year labor are finally starting to show with Zig 0.15.1. The Ghostty project just completed upgrading to Zig 0.15.1, and I'd like to share some real-world build times.3 Build Script Compilation Zig 0.14: 7sec 167ms Zig 0.15: 1sec 702ms This is the time it takes to build the build.zig script itself. The times above were measured by running zig build --help. A well-written build script should only rebuild itself rarely. However, this is a cost every new uncached source build will pay (e.g. a user downloading the project to build from source one time). As such, it directly impacts the time to build a usable binary. Full Uncached Ghostty Binary Zig 0.14: 41sec Zig 0.15: 32sec This includes the time to build the build script itself. Given the prior results, Zig 0.15 is building everything else ~2 seconds faster. But, you can still see in wall time the change in this initial build time. Important: most of this is still using LLVM. Ghostty still can't fully build and link using the self-hosted x86_64 backend, since the backend still has bugs. So, this just shows the general improvements in the Zig compiler itself, even with LLVM in the picture. Once Ghostty can use the self-hosted x86_64 backend completely, I expect this time to plummet to around 25 seconds or less, fully half the time it would take with Zig 0.14. Incremental Build (Ghostty Executable) Zig 0.14: 19sec Zig 0.15: 16sec This is the time it takes to rebuild Ghostty after a one-line change to the most core terminal emulation code (adding a ...

First seen: 2025-10-03 23:54

Last seen: 2025-10-05 00:59