Replies: 1 comment 1 reply
-
Thanks for coming here to raise this request. I'm well aware that splitting up projects into multiple crates can improve compile times. Code organization wise this would be something that would be interesting for diesel as well, but it's not something that's high on my priority list (read that as not for the 2.0 release and not for a potential 2.1 release). That written I will likely not stop anyone from working on this as long as it does not infer to much with my own work. In this case I would expect a proposal first that outlines which part belongs to which newly created crate and how we can maintain the "same" public API afterwards. That all written: I don't believe it will have that large impacts on your compile time. I think you don't you understand how different diesel is to the normal compiler workload. This means the "normal" strategies to optimize compile times won't have much effect here. |
Beta Was this translation helpful? Give feedback.
-
Diesel is currently very slow to compile, because it only consists of a single crate, which Rust compiles on a single thread. You can see that in the graph below.
The best solution is to split the project into multiple separate crates. This is what we did with Lemmy, and in my experience it also helped a lot to optimize the code better. I wrote an explanation here for generating and interpreting the build graph. The Rust documentation also has some info on it.
If anything about this is unclear to you, I will try my best to answer your questions.
cc @dessalines
Beta Was this translation helpful? Give feedback.
All reactions