So, I was thinking about this. Looking beyond the RLS + incremental for a second, there are a number of proposed ideas that I think could have a significant effect on overall compilation time. Many of them will benefit one another, as well:
- End-to-end queries
- Right now, parsing + macro-expansion + name-resolution are not part of the query system and incremental can’t do anything with them
- Creating the incremental infrastructure from the start would let us start to change that
- This would be very useful for RLS integration of queries, I think
- However, this “session” code is grungy and old and I think this is probably non-trivial. We sketched out some plans at Rust All Hands, I’d have to go back to our notes, but I remember the conclusion was “this will be work”.
- This is also one place where the libsyntax2 story definitely intesects
- Parallelize the compiler (tracking issue)
- @Zoxc did awesome work enabling us to parallelize the compiler
- But the last mile isn’t done! There were various refactorings and architectural changes we wanted to make as well.
- It is not integrated with incremental, either
- We’ve not done much measuring of perf
- Multicrate sessions
- The “full vision” for queries is that we should be able to compile many crates at once, as I talked about earlier
- This might allow us to skip a lot of work
- MIR-only rlibs (tracking issue)
- Right now, our rlibs contain actual executable code
- The idea here is that we just store MIR in the rlibs so that we can do a better job reducing duplicates and so forth
- Erasing types where possible
- We’ve often discussed (most recently here) the idea of erasing types (to reduce monomorphization overhead) when we can tell it’s safe. This is a big job but a worthwhile one.