Re:Rust in Linux kernel is just a beginning
by nevi-me on Tuesday October 25, 2022 @04:59AM
(#33328005)
There was a PR merged yesterday which should give us 5-10% improvements in compile times [0]. As long as there are people monitoring and working on compile times, one could optimistically hope that as more companies become willing to throw money at Rust, we'll see improvements over time.
Regardless of how fast one's machine is, I think having some compile caching infra like sscache should help improve time to compile.
[0] https://perf.rust-lang.org/compare.html?start=9be2f35a4c1ed1...
Re:Rust in Linux kernel is just a beginning
by a4a4a4a4 on Tuesday October 25, 2022 @05:14AM
(#33328112)
> but if the borrow checker is really the slowest part, maybe making rust skip it is a valid approach for end users.
Relevant username?...
Re:Rust in Linux kernel is just a beginning
by unsafecast on Tuesday October 25, 2022 @05:21AM
(#33328172)
I mean, if the people that write the code don't skip it, I don't see the issue. The code in the source tree is supposed to be safe, so you might as well not do borrow checking and whatever other safety stuff you have.
Re:Rust in Linux kernel is just a beginning
by sebzim4500 on Tuesday October 25, 2022 @10:02AM
(#33330585)
If you aren't changing the code yourself, then why not download a binary? And if you are changing it, then you probably don't want to turn off the borrow checker.
Re:Rust in Linux kernel is just a beginning
by EugeneOZ on Tuesday October 25, 2022 @05:00AM
(#33328017)
By “biggest” I meant “giving the biggest impact”. I don't know if it's the slowest part.
Re:Rust in Linux kernel is just a beginning
by Gigachad on Tuesday October 25, 2022 @06:29AM
(#33328626)
Why not skip the whole compilation step and just download the precompiled kernel? There is really no point compiling software you didn’t modify and if you did modify it, you want the borrow checker on.
Re:Rust in Linux kernel is just a beginning
by alpaca128 on Tuesday October 25, 2022 @08:17AM
(#33329483)
The borrow checker is only one reason for the slow compile times. Cargo provides a separate `check` command to only do code & typechecking and that can be much faster than full compilation. LLVM and the way rustc interacts with it also plays a role.
In my experience when compilation takes longer the actual delays are in the last steps, long after the compiler is done checking and printing warnings.
On an unrelated note, I also noticed a large amount of static string literals in the code can slow down compilation to a surprising degree.
I haven't checked the times, but if the borrow checker is really the slowest part, maybe making rust skip it is a valid approach for end users. Sounds like an interesting experiment.