Comment

Comment by AndyKelley

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.

parent AndyKelley 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton