News for hackers. Stuff that matters.
Re:Why is my Rust build so slow? by fasterthanlime on Friday December 31, 2021 @08:06AM (#29747635)
Seems like you really need to finish reading the article: hot builds take 3s by the time I find the regression that caused pathological compile times.
Re:Why is my Rust build so slow? by yawaramin on Friday December 31, 2021 @11:59AM (#29749886)
You mean, by the time you split up the project into a bunch of tiny crates and mention:

> I don't love how the dependency graph looks

After adding this complexity to the project, yes, some of the crates are building in ~3s, if they are the only ones that needed to be rebuilt.

Meanwhile, in a Java project there is none of this artificial crate splitting. Sure, Java projects have other nonsense, but they don't force you to split up projects into tiny pieces to get decent compile times.

Re:Why is my Rust build so slow? by estebank on Friday December 31, 2021 @01:01PM (#29750617)
It's a tradeoff: if you make the file the language's compilation unit, then you can't have "circular imports" to allow end users divide their code in an ergonomic manner with fewer "arbitrary" restrictions. We can argue all year on whether Rust settled on the right side of that trade-off.
Re:Why is my Rust build so slow? by yawaramin on Friday December 31, 2021 @05:59PM (#29753405)
I'm just surprised that no one has (to my knowledge, anyway) tried this even experimentally. Wouldn't the potential build speed improvement be worth at least trying out the one-file-per-crate strategy?