aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-08-13 16:13:42 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-13 16:15:46 -0700
commit6ae05b419922193c4c253e51c9a5e483e4f947fa (patch)
treee06491f807689124cad73a2011af2db821e390e1 /src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
parentce170540ba5401e926a5433e6e35b1d22426e525 (diff)
Order Skyframe evaluations in a priority queue, with all children of a given node having the same priority, later enqueueings having higher priority, re-enqueued nodes having highest priority, and new root nodes having lowest priority. Experimentally, this can save significant RAM (1.4G in some builds!) while not affecting speed.
Also do a semi-drive-by deleting ExecutorFactory parameter to AbstractQueueVisitor, since it was always AbstractQueueVisitor.EXECUTOR_FACTORY. PiperOrigin-RevId: 208560889
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
index f8f21f254e..268db07014 100644
--- a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
@@ -249,7 +249,9 @@ public abstract class AbstractExceptionalParallelEvaluator<E extends Exception>
// This must be equivalent to the code in enqueueChild above, in order to be thread-safe.
switch (entry.addReverseDepAndCheckIfDone(null)) {
case NEEDS_SCHEDULING:
- evaluatorContext.getVisitor().enqueueEvaluation(skyKey);
+ // Low priority because this node is not needed by any other currently evaluating node.
+ // So keep it at the back of the queue as long as there's other useful work to be done.
+ evaluatorContext.getVisitor().enqueueEvaluation(skyKey, Integer.MIN_VALUE);
break;
case DONE:
informProgressReceiverThatValueIsDone(skyKey, entry);