diff options
author | janakr <janakr@google.com> | 2018-08-14 21:38:51 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-14 21:40:26 -0700 |
commit | 7574d84e61086b5835a2b2cc003ca72fcfcf4fe4 (patch) | |
tree | c1fdc7992d6ffe9168112e5474917b0cb854a7c7 /src/main/java/com/google/devtools/build/skyframe/EventFilter.java | |
parent | 8dece49bed76b5f372ff5d3a3f25a32b2a9c1f52 (diff) |
Filter out events from analysis when constructing execution-phase values in Skyframe.
This avoids some unnecessary iteration over already-emitted events that can show up in profiles, and allows us to store execution-phase values a bit more compactly, since we don't need to carry around wrapper objects and nested sets everywhere.
This crucially depends on the fact that we can't build a target in the execution phase without first having analyzed it in a separate Skyframe call. Skyframe normally propagates all events/posts up the graph because it must be able to emit them if a user requests a node that only transitively depends on the node that emitted an event. However, because we do analysis in a separate Skyframe call, any warnings/posts associated with the analysis nodes will be emitted then, and we don't need to propagate them into execution.
PiperOrigin-RevId: 208767078
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/EventFilter.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/EventFilter.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/EventFilter.java b/src/main/java/com/google/devtools/build/skyframe/EventFilter.java index 0b859d24ff..3dc527ea34 100644 --- a/src/main/java/com/google/devtools/build/skyframe/EventFilter.java +++ b/src/main/java/com/google/devtools/build/skyframe/EventFilter.java @@ -14,6 +14,7 @@ package com.google.devtools.build.skyframe; import com.google.common.base.Predicate; +import com.google.common.base.Predicates; import com.google.devtools.build.lib.events.Event; /** Filters out events which should not be stored during evaluation in {@link ParallelEvaluator}. */ @@ -23,4 +24,8 @@ public interface EventFilter extends Predicate<Event> { * avoid doing unnecessary work when evaluating node entries. */ boolean storeEventsAndPosts(); + + default Predicate<SkyKey> depEdgeFilterForEventsAndPosts(SkyKey primaryKey) { + return Predicates.alwaysTrue(); + } } |