nikomatsakis ([personal profile] nikomatsakis) wrote in [personal profile] tim 2012-07-19 01:42 pm (UTC)


It seems to me there are three options for caching the compiled code:

- ASTs
- Generated LLVM bitcode
- Compiled code

ASTs are probably useless since most of our time is spent in trans and LLVM. Generated bitcode avoids re-running trans and avoids issues around inlining as well, but still requires that we pay the full LLVM price. 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. I kind of think caching LLVM bitcode is the best "bang for our buck" but I could be persuaded otherwise.

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.

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.