4 ms·
I'm not an expert on the language, but I see Rust's build times as fairly justified. Rust's focus is on execution speed and correctness, which means that the co
by smoldesu 5y ago
I'm not an expert on the language, but I see Rust's build times as fairly justified. Rust's focus is on execution speed and correctness, which means that the compiler needs to be extremely pedantic with CPU targets to know how to optimize your release. Once you have a target outlined, it has to acquire and build the latest versions of your dependencies with the highest level of optimization possible for your specific architecture... that's just a lot of computing, period. Caching is a half-solution to this as the author suggests, but frankly there isn't much juice left to squeeze out of the Rust fruit.
Now, there are still ways to make the compiler choke: the mention of instantiations towards the end is a great example. But in my (non-professional) experience, the build times are pretty tolerable for what it's providing.
- ReactiveJelly 5y agoThe critics are right that the build times are slow even in debug mode, and that it's one of the most frustrating things about the language even for experienced users. There are some alternate codegen backends that aim to fix this by compiling less-optimized debug builds more quickly.
- sodality2 5y agoOoh, got a link to any of those alternate backends?
- pjmlp 5y agoFor example Cranelift and using lld as linker. Also read the Bevy documentation about improving build times.
- PoignardAzur 5y agoI wouldn't hold my breath too much. Something I noticed since I've started timing builds is that codegen and linking usually takes less than 30% of the build time for an incremental build. So in practice, switching to Cranelift and lld/mold will shave maybe 2 seconds off a 10-seconds build. Better, but still flow breaking. If we want Go-like compile times, we're going to need some more fundamental improvements to the compiler.
- rhn_mk1 5y agoWhat is the reason to downvote this?
- lostdog 5y agoI didn't downvote it, but it feels like the parent comment is making excuses for rust build times being slow. As someone who's worked with C++, slow build times are a leech to productivity, and I expect new languages to have a better solution than "whatever."
- eminence32 5y ago> the build times are pretty tolerable for what it's providing. I think this is probably right, and I think just about everyone "tolerates" the build times (that is, I see very few people stop developing in rust because of the build times). But when, for example, I run `rustup update` to get a new nightly compiler and have to re-compile everything, it's annoying to have to wait 20 minutes. I'll tolerate it, and if a magic wand could make it instantaneous I would love that. But it's still annoying.
- tanaypingalkar 5y agoI have a low spec machine but i still patiently wait for 200 crates to download.Because it is cached. But the most annoying thing is that when I am using any frameworks like gui and game. The second compilation also takes a minute to start the app. I have ended up with them. :(
- Kenji 5y agoPeople who complain that Rust build times are too slow are python and webshit cucks who have no clue about what it means to compile a million lines project for a particular architecture. They never compiled C++ projects and they have no clue that C++ compile times are comparable to if not slower than Rust compile times. Long story short: People who complain about Rust build times are clueless morons.