Compile Times and Code Graphs
Cross-posted on the Materialize Blog.
At Materialize, Rust compile times are a frequent complaint. On one hand, I’m forever anchored by the Scala compile times from my days at Foursquare; a clean build without cache hits took over an hour. On the other, Go at Cockroach Labs was great. Rust is in between, but much closer to Go than to Scala.
So far, I’ve mostly insulated myself from this here by carving out an isolated corner where unit tests catch almost all the bugs and so iteration is fast. But recently, I’ve been pitching in on some cross-cutting projects, felt the pain that everyone else is feeling, and so was motived to improve them a bit. Here’s how I did it.
First, a note that there are lots of other ways to improve compile times1, but today we’re going to talk about dependency graphs in code.
In general, the following will be talking about the smallest compilation unit that d...
Continue reading →