Another meme answer: nu
.
I never actually used nu
for anything. But I’ve been thinking (unironically) that nu
with its built-in from_json
and to_json
can be interesting.
The use-case I had in mind is not games or anything like that, but some system or dev tools that traditionally utilized shell scripts, but are moving towards better languages like python. So I thought a single binary that embeds nu
, but also has a lot of sub-commands that implement a lot of sub-tasks in Rust directly, and with JSON used as an exchange format, the combination can be interesting.
Now that I think about it more, this can work in both directions, with main execution being in nu (what I had in mind), or in Rust.
nu
even has an lsp server, so the development experience should theoretically be good.
With all the respect to the author and his
wild
experiments, that title does not match the linker-only focus of the content.So not only the post ended up with two (IMHO) bad recommendations (disabling debug info, building non-relocatable binaries with musl). But it also didn’t mention other important factors like
codegen-units
andcodegen-backend
. Since you know, code generation is the other big contributor to the cycle time (the primary contributor even, in many cases). There is also other relevant options likelto
andopt-level
.Let’s assume that
opt-level
shouldn’t be changed from defaults for no good reason.With
codegen-units
, it’s not the default that is the problem, but the fact that some projects set it to 1 (for performance optimization reasons), but without adding a separate profile for development release builds (let’s call itrelease-dev
).Same goes for
lto
, where you can have it set to"full"
in your optimized profile, and completely"off"
inrelease-dev
.And finally, with
codegen-backend
, you can enjoy what is probably the biggest speed up in the cycle by usingcranelift
in yourrelease-dev
profile.And of course you are not limited to just two release profiles. I usually use 3-4 myself. Profile inheritance makes this easy.
And finally, you can set/not set some of those selectively for your dependencies. For example, not using
cranelift
for dependencies can render the runtime performance delta negligible in some projects.Using the parallel rustc front-end might become an interesting option too, but it’s not ready yet.