Skip to content

Commit

Permalink
Avoid slow removeAll calls
Browse files Browse the repository at this point in the history
wendigo committed Jan 22, 2025
1 parent e38277f commit a17efc1
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -325,9 +325,9 @@ private boolean doRemoveTask(TimeSharingTaskHandle taskHandle)

splits = taskHandle.destroy();
// stop tracking splits (especially blocked splits which may never unblock)
allSplits.removeAll(splits);
intermediateSplits.removeAll(splits);
blockedSplits.keySet().removeAll(splits);
splits.forEach(allSplits::remove);
splits.forEach(intermediateSplits::remove);
splits.forEach(blockedSplits.keySet()::remove);
waitingSplits.removeAll(splits);
recordLeafSplitsSize();
}
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ void updateMonitoredServices()
.map(ServiceDescriptor::getId)
.collect(toImmutableList());

tasks.keySet().removeAll(expiredIds);
expiredIds.forEach(tasks.keySet()::remove);

// 2. disable offline services
tasks.values().stream()

0 comments on commit a17efc1

Please sign in to comment.