diff options
author | 2018-08-05 15:55:50 -0700 | |
---|---|---|
committer | 2018-08-05 15:57:45 -0700 | |
commit | 93fc13e1c9c55bc7fce12fd20ef2917b726b7ae0 (patch) | |
tree | c45f49cb990a0adea2165fbc4615041a76629ee7 /src/main | |
parent | 68cbbe96e8b28e8de50228275f7d2d83c2bb137b (diff) |
Use fact that the subgraph of ActionLookupValues has the same transitive dependency relations as the full graph to avoid descending into non-ActionLookupValue parts of the graph when collecting ActionLookupValues.
PiperOrigin-RevId: 207472612
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java index 9b879db1e7..a86d51a58f 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java @@ -798,7 +798,10 @@ public final class SkyframeBuildView { private static void findActionsRecursively( WalkableGraph walkableGraph, SkyKey key, Set<SkyKey> seen, List<ActionLookupValue> result) throws InterruptedException { - if (!seen.add(key)) { + if (!(key instanceof ActionLookupValue.ActionLookupKey) || !seen.add(key)) { + // The subgraph of dependencies of ActionLookupValues never has a non-ActionLookupValue + // depending on an ActionLookupValue. So we can skip any non-ActionLookupValues in the + // traversal as an optimization. return; } SkyValue value = walkableGraph.getValue(key); |