3 ms·
Don't use a single monolithic crate. Break your project up into multiple crates. Not only does this help with compile time (the individual crate compiles can be
by lilyball 1y ago
Don't use a single monolithic crate. Break your project up into multiple crates. Not only does this help with compile time (the individual crate compiles can be parallelized), it also tends to help with API design as well.
- mixmastamyk 1y agoIt compiles different files separately, right? With some exceptions for core data structures, it seems that if you only modified a few files in a large project the total compilation time would be quick no matter how slow the compiler was.
- conradludgate 1y agoSorta. The "compilation unit" is a single crate, but rustc is now also parallel, and LLVM can also be configured to run in parallel IIRC. Rust compile times have been improving over time as the compiler gets incrementally rewritten and optimised.
- Seattle3503 1y agoEvery project I've worked on used a workspace with many crates. Generally that only gets you so far on large projects.