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/InMemoryMemoizingEvaluator.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/InMemoryMemoizingEvaluator.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java index e8f9a91648..42ab317df3 100644 --- a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java +++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java @@ -63,6 +63,7 @@ public final class InMemoryMemoizingEvaluator implements MemoizingEvaluator { private final InvalidationState deleterState = new DeletingInvalidationState(); private final Differencer differencer; private final GraphInconsistencyReceiver graphInconsistencyReceiver; + private final EventFilter eventFilter; // Keep edges in graph. Can be false to save memory, in which case incremental builds are // not possible. @@ -90,6 +91,7 @@ public final class InMemoryMemoizingEvaluator implements MemoizingEvaluator { differencer, progressReceiver, GraphInconsistencyReceiver.THROWING, + DEFAULT_STORED_EVENT_FILTER, new EmittedEventState(), true); } @@ -99,12 +101,14 @@ public final class InMemoryMemoizingEvaluator implements MemoizingEvaluator { Differencer differencer, @Nullable EvaluationProgressReceiver progressReceiver, GraphInconsistencyReceiver graphInconsistencyReceiver, + EventFilter eventFilter, EmittedEventState emittedEventState, boolean keepEdges) { this.skyFunctions = ImmutableMap.copyOf(skyFunctions); this.differencer = Preconditions.checkNotNull(differencer); this.progressReceiver = new DirtyTrackingProgressReceiver(progressReceiver); this.graphInconsistencyReceiver = Preconditions.checkNotNull(graphInconsistencyReceiver); + this.eventFilter = eventFilter; this.graph = new InMemoryGraphImpl(keepEdges); this.emittedEventState = emittedEventState; this.keepEdges = keepEdges; @@ -187,7 +191,7 @@ public final class InMemoryMemoizingEvaluator implements MemoizingEvaluator { skyFunctions, eventHandler, emittedEventState, - DEFAULT_STORED_EVENT_FILTER, + eventFilter, ErrorInfoManager.UseChildErrorInfoIfNecessary.INSTANCE, keepGoing, numThreads, |