4 ms·
Many people are not aware that - currently - Zig completely rebuilds your entire application with every compilation - including any parts of the standard librar
by AndyKelley 3y ago
Many people are not aware that - currently - Zig completely rebuilds your entire application with every compilation - including any parts of the standard library you use. There is not yet any incremental compilation.
It takes a lot of time investment to make compilation fast, and we have gone all in on this investment. There was almost an entire year when not much happened besides the compiler rewrite (which is now done). Finally, we are starting to see some fruits of our labor. Some upcoming milestones that will affect compilation speed:
* x86 backend (90% complete) - eliminates the biggest compilation speed bottleneck, which is LLVM.
* our own self-hosted ELF linker - instead of relying on LLD, we tightly couple our linker directly with the compiler in order to speed up compilation.
* incremental compilation (in place binary patching) - after this Zig will only compile functions affected by changes since the last build.
* Interned types & values. Speed up Semantic Analysis which is the remaining bottleneck of the compiler
* Introduce a separate thread for linking / machine code generation, instead of ping-ponging between Semantic Analysis & linking/mcg
* Multi-threaded semantic analysis. Attack the last remaining bottleneck of the compiler with brute force
Anyway, I won't argue with cold hard performance facts if you have some to share, but I won't stand accused of failing to prioritize compilation speed.
- ragnarsson 3y agoThanks Andrew, for me a big frustration with Rust is the compilation times coming from Go. Based on your Milan presentation as well, I have a lot of hope that Zig is seriously pushing on this.