How important is crate splitting for rust compilation performance these days?

62 points thurn2

I've been working on a rust project for a year or so which is a little over 100,000 lines of code at this point. I've been trying to do a good job of keeping it separated into several different crates because I've heard this is really important to keep rust compilation fast.

However, I've really started to notice that keeping this separation imposes a serious cost on the architecture. I keep running into situations where I want to have data types and traits in crate A that really want to call functions in child crate B for their implementation. This actually translates into a runtime performance cost for me because I tend to end up using Box<dyn Trait> a lot more often than I would otherwise, just so I can provide an implementation in another crate and use it via dynamic dispatch.

Is crate splitting like this still a big performance benefit for rust? I'm pretty happy overall with the incremental build times I get (usually 10-20 seconds), but I certainly don't want them to get significantly worse.