diff options
author | Eric Fellheimer <felly@google.com> | 2016-01-21 19:17:19 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-01-22 15:53:27 +0000 |
commit | 1a34a248b05c9e64e2db0d76f3ad8e93cf755f99 (patch) | |
tree | 700009696af0f00536e6880394af4b00dfae95c1 /src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java | |
parent | 0bf232e1bdf711012899298d9aa9734a40636861 (diff) |
Improve space efficiency of Blaze action cache: For actions that don't perform input discovery, there is no need to store the full set of edges in the action cache. This data is only used to formulate the set of input files for an action prior to checking the validity of a cache entry. For non-input-discovering actions, the set of input files is known statically and the action cache data is not used.
--
MOS_MIGRATED_REVID=112704382
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java b/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java index 3c4e5ada78..72d5756c42 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java @@ -202,7 +202,7 @@ public class ActionCacheChecker { } else if (validateArtifacts(entry, action, actionInputs, metadataHandler, true)) { reportChanged(handler, action); return true; // files have changed - } else if (!entry.getActionKey().equals(action.getKey())){ + } else if (!entry.getActionKey().equals(action.getKey())) { reportCommand(handler, action); return true; // must execute -- action key is different } @@ -219,7 +219,8 @@ public class ActionCacheChecker { // This cache entry has already been updated by a shared action. We don't need to do it again. return; } - ActionCache.Entry entry = actionCache.createEntry(action.getKey()); + ActionCache.Entry entry = + actionCache.createEntry(action.getKey(), action.discoversInputs()); for (Artifact output : action.getOutputs()) { // Remove old records from the cache if they used different key. String execPath = output.getExecPathString(); @@ -297,7 +298,7 @@ public class ActionCacheChecker { // Compute the aggregated middleman digest. // Since we never validate action key for middlemen, we should not store // it in the cache entry and just use empty string instead. - entry = actionCache.createEntry(""); + entry = actionCache.createEntry("", false); for (Artifact input : action.getInputs()) { entry.addFile(input.getExecPath(), metadataHandler.getMetadataMaybe(input)); } |