In order to speed up your linking stage, you can use a linker that takes advantage of multiple CPU cores.
Such linkers are lld and mold.
mold is considered more cutting edge, but it works for me.
Just add
[build]
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
into ~/.cargo/config.toml
.
Here are some additional details: https://nnethercote.github.io/perf-book/compile-times.html
You can do it for a single repository, only, if you add it into .cargo/config.toml
inside the repository folder.
And changing mold to lld changes the linker.
sudo apt install mold to get the right in the first place.
At least on Debian and Ubuntu.