Hi all,
When working with a compiled language (like Rust, in this case), you must often rebuild the project to test your changes. On my system, after a small change, rebuilding Agama takes around 4 seconds[1]. TIL that most of the time is spent by the linker, and you
can switch to a faster one if you wish. In my case, the build time was reduced to around 1.6 seconds.
AFAIK, you have two options: lld[2] and mold[3], and both of them are available in openSUSE Tumbleweed.
You need to install "clang" and "lld" or "mold" packages. Then, add the following lines to your ~/.cargo/config.toml file:
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]
Replace "lld" with "mold" if you prefer. And that's all 🙂
PS: you can want to know how much time it takes to compile each crate, try "cargo build --timings" and check the generated report.
Regards,
Imo
[1] Bear in mind that a complete rebuild takes around 35-40 seconds if the dependencies are already downloaded, but that's a different history.