tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
Tim Chevalier ([personal profile] tim) wrote 2012-07-23 11:28 pm (UTC)

Re: Dependencies

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.

Post a comment in response:

Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User (will be screened if not on Access List)
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.