Skip to content

Commit

Permalink
Fix memory regression caused by 91d2c11 .
Browse files Browse the repository at this point in the history
That change added a dependency on the a nested set that was almost always empty, which resulted an unnecessary and useless Skyframe dependency edge for many actions.

The fix is to check whether the nested set is empty before adding a dependency on it.

Naively, one would think that we could do the same thing with `nonLeaf` above, but `NestedSetBuilder.addTransitive()` already filters out empty nested sets so doing the same emptiness check for `nonLeaf` would be useless.

RELNOTES: None.
PiperOrigin-RevId: 563662609
Change-Id: I4ea3b250f75b9fad8e7532e6e0675469eccb220f
  • Loading branch information
lberki authored and copybara-github committed Sep 8, 2023
1 parent c08cc85 commit d57e0a7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ private static Iterable<SkyKey> getInputDepKeys(
state.requestedArtifactNestedSetKeys.add(ArtifactNestedSetKey.create(nonLeaf));
}

state.requestedArtifactNestedSetKeys.add(ArtifactNestedSetKey.create(schedulingDependencies));
if (!schedulingDependencies.isEmpty()) {
state.requestedArtifactNestedSetKeys.add(
ArtifactNestedSetKey.create(schedulingDependencies));
}
}

return Iterables.concat(directKeys, state.requestedArtifactNestedSetKeys);
Expand Down

0 comments on commit d57e0a7

Please sign in to comment.