-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: only rebuild dependent packages when export data has changed #15752
Comments
It's not trivial. Years a go I worked on an ahead-of-time compiler for Java bytecodes that did just this, and it was a good thing (back in the days of 200Mhz CPUs), but it required substantial amounts of dependence information (stored on disk in gzip format) and it also required that every reference to information from another package log an entry in the internal dependence database for later storage -- in particular, every field reference or interface method reference, because those involve offsets, and offsets might change as interface declarations or field declarations are changed (granularity matters, too -- do you record the actual dependence that field F is at offset 8, or do you just record that the SHA of the struct had a particular value? |
IIUC, the plan would be to do something like check the SHA of the export data. If that hasn't changed, then the downstream compilation won't change. |
Yeah, I was just thinking that you'd store the SHA1 of the export data of I don't know often this would be useful. Certainly sometimes (especially in On 20 May 2016 at 06:56, Josh Bleecher Snyder [email protected]
|
Régis Crelier (currently at Google) has investigated this issue for Oberon in very much detail - I believe much of his work should be directly applicable to Go. For details see: |
@rsc will this be a part of your cmd/go re-building improvements? |
Yes the plan is that we'll be set up well to take advantage of this. |
Note that if we do much with #25999, the set of code changes that leave export data unchanged might shrink significantly. |
Is this now just (“just”) a matter of only hashing the export data when determining whether object files are stale? |
I think so, yes. |
I think it's a little bit more than that because you still need to re-link any executables? |
@mwhudson suggested in #15734:
Moving this idea here to be tracked separately.
My 2c: Interesting idea, seems worth pursuing. Not sure how often it happens that code changes don't impact export data (or how cheap that is to detect), but when it does happen, that could save a bunch of computation.
The text was updated successfully, but these errors were encountered: