Comment by kristoff_it

6 months ago

Zig is starting to migrate to custom backends for debug builds (instead of using LLVM) plus incremental compilation.

All Zig code is built in a single compilation unit and everything is compiled from scratch every time you change something, including all dependencies and all the parts of the stdlib that you use in your project.

So you've been comparing Zig rebuilds that do all the work every time with Rust rebuilds that cache all dependencies.

Once incremental is fully released you will see instant rebuilds.

When does this land in Zig? Will aarch64 be supported?

  • When targeting x86_64, the self-hosted backend is already enabled by default on the latest builds of Zig (when compiling in Debug mode). The self-hosted aarch64 backend currently isn't generally usable (so we still default to LLVM when targeting aarch64), but it's likely to be the next ISA we focus on codegen for.

I was comparing end-to-end builds. I pay more attention to build times than someone who doesn't do it for a living typically does.

https://bitemyapp.com/blog/rebuilding-rust-leptos-quickly/

https://old.reddit.com/r/rust/comments/1i2pr2e/improve_rust_...

https://old.reddit.com/r/rust/comments/ua09tc/experimental_f...

https://old.reddit.com/r/rust/comments/1k9ihhn/does_breaking...

https://old.reddit.com/r/rust/comments/x9z4cm/speeding_up_in...

https://old.reddit.com/r/rust/comments/rlszeq/the_best_cpu_f...

https://old.reddit.com/r/rust/comments/1hpuy01/why_you_need_...

https://old.reddit.com/r/rust/comments/1h9bdbr/rust_llvm_by_...

https://old.reddit.com/r/rust/comments/1j1rvy1/help_me_under...

Anyhoodle, I'm looking forward to testing the compile times again when Zig says the build times are fast now.

But if we're talking about incrementality, I look forward to testing that too when it's ready. I've got a Bazel build for work that pulls together Rust along with a custom (very slow) compiler and the cached successful pipelines take 2-3 minutes (mostly the benchmark run) and the ones that churned the non-rust take 15-18 minutes, of which about 10-11 minutes is just compiling the non-rust.