Yeah, I wasn't even considering caching ASTs; I thought that would be pointless, since at least right now, the bottleneck is in trans and LLVM.
I think I can do a lot of the work (like simply computing the dependency graph) without deciding whether the eventual goal is to cache bitcode or object code, so I'm ok with postponing that decision for a while.
Caching compiled code will, I would guess, be the most complex and result in slower executables since LLVM will not be optimizing the whole crate as a unit, though if we're doing a non-optimizing build that's obviously fine.
Maybe there are some heuristics that can be applied here? Like "for a one-line source change, don't bother to recompile the whole crate; for larger changes, maybe it won't lose much time to just recompile everything and then we'll get the benefit of optimization."
One other comment on items vs files: in general, rustc quickly forgets the file from which code originated, so I actually think doing the caching at the level of items or modules will be the easiest.
That's good to know... items makes more sense to me, but I didn't know if the bookkeeping was likely to become too complex or not.
Re: Dependencies
I think I can do a lot of the work (like simply computing the dependency graph) without deciding whether the eventual goal is to cache bitcode or object code, so I'm ok with postponing that decision for a while.
Caching compiled code will, I would guess, be the most complex and result in slower executables since LLVM will not be optimizing the whole crate as a unit, though if we're doing a non-optimizing build that's obviously fine.
Maybe there are some heuristics that can be applied here? Like "for a one-line source change, don't bother to recompile the whole crate; for larger changes, maybe it won't lose much time to just recompile everything and then we'll get the benefit of optimization."
One other comment on items vs files: in general, rustc quickly forgets the file from which code originated, so I actually think doing the caching at the level of items or modules will be the easiest.
That's good to know... items makes more sense to me, but I didn't know if the bookkeeping was likely to become too complex or not.