Reintroduce proper action prioritization that got accidentally disabled. This
now always creates the AtomicInteger globalEnqueueIndex, even when
ForkJoinPools are used. I think the performance benefit not doing that does not
justify the additional complexity doing it selectively.
RELNOTES: None.
@@ -64,7 +64,7 @@ public abstract class AbstractParallelEvaluator {
final ProcessableGraph graph;
final ParallelEvaluatorContext evaluatorContext;
protected final CycleDetector cycleDetector;
- @Nullable private final AtomicInteger globalEnqueuedIndex;
+ private final AtomicInteger globalEnqueuedIndex;
AbstractParallelEvaluator(
ProcessableGraph graph,
@@ -103,7 +103,7 @@ public abstract class AbstractParallelEvaluator {
progressReceiver,
(skyKey, evaluationPriority) -> new Evaluate(evaluationPriority, skyKey)),
evaluationVersionBehavior);
- this.globalEnqueuedIndex = null;
+ this.globalEnqueuedIndex = new AtomicInteger();
}
/**
@@ -292,9 +292,7 @@ public abstract class AbstractParallelEvaluator {
continue;
}
handleKnownChildrenForDirtyNode(
- unknownStatusDeps,
- state,
- globalEnqueuedIndex != null ? globalEnqueuedIndex.incrementAndGet() : 0);
+ unknownStatusDeps, state, globalEnqueuedIndex.incrementAndGet());
return DirtyOutcome.ALREADY_PROCESSED;
}
switch (state.getDirtyState()) {
@@ -634,8 +632,7 @@ public abstract class AbstractParallelEvaluator {
Set<SkyKey> newDepsThatWereInTheLastEvaluation =
Sets.difference(uniqueNewDeps, newDepsThatWerentInTheLastEvaluation);
- int childEvaluationPriority =
- globalEnqueuedIndex != null ? globalEnqueuedIndex.incrementAndGet() : 0;
+ int childEvaluationPriority = globalEnqueuedIndex.incrementAndGet();
InterruptibleSupplier<Map<SkyKey, ? extends NodeEntry>>
newDepsThatWerentInTheLastEvaluationNodes =
graph.createIfAbsentBatchAsync(
