Repository navigation
Associate deps cache files with the depended upon module - #6263
Merged
Merged
Conversation
JukkaL
reviewed
Jan 29, 2019
JukkaL
left a comment
Collaborator
There was a problem hiding this comment.
Great, this should make daemon cold build using remote cache significantly faster. It also looks like this can save a good chunk of memory, which is a nice bonus.
Did a quick pass and mostly left questions and requests for clarification. I'll do a more detailed pass tomorrow.
JukkaL
approved these changes
Jan 30, 2019
JukkaL
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the updates! The code is now much easier to understand. This is a great approach to speed up daemon startup. Left a few additional minor comments.
| fg_deps_meta = manager.fg_deps_meta.copy() | ||
|
|
||
| for id in rdeps: | ||
| if id != '@root': |
Collaborator
There was a problem hiding this comment.
What about using a constant for '@root'?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the fine-grained deps cache file for a module contains all the
fine-grained dependencies from the module (that is, those whose
targets are in the module). This has the advantage that producing fine-grained
dependency cache files is nicely localized (just run it on a module), but
the downside that loading the fine-grained deps cache is a global operation,
requiring every cache file to be loaded.
To improve daemon performance, we invert this, and have the deps cache file
for a module contain the fine-grained dependencies to the module. This
complicates creating the cache files: we need to explicitly sort out triggers
into the appropriate cache file.
This, then, allows us to postpone loading deps cache files until the module
is updated.
Because protocol dependencies now get sorted out into modules like everything
else, this notionally eliminates the special protocol deps cache. In practice, the
protocol deps cache has morphed in a cache for 'extra' dependencies that weren't
placed somewhere else (either because the module doesn't exist or because they
were added in an incremental run) and the meta file for it has grown additional
metadata to check consistency of the deps cache. (Because deps files are now
written after metadata, we can't store info about the in the metadata files.)