Repository navigation
Filter waiting queue tasks in place - #7537
Merged
6543 merged 7 commits intoNov 11, 2026
Merged
Conversation
filterWaiting moved every waiting task back to pending and rebuilt the waiting list on each 100ms tick. Only move tasks whose state changes, keeping the same resulting order. This cuts time by 46-66% and almost all allocations for queues with dependencies.
Member
|
lint fails ... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7537 +/- ##
==========================================
+ Coverage 66.40% 66.47% +0.07%
==========================================
Files 449 449
Lines 22478 22507 +29
==========================================
+ Hits 14926 14962 +36
+ Misses 7552 7545 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6543
reviewed
Nov 10, 2026
Member
well from |
6543
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description:
On every 100 ms scheduling tick,
filterWaitingmoved all tasks that were waiting on dependencies back intopending, created a new waiting list and filtered everything again. With many queued tasks that have dependencies, this cost almost a millisecond and ~20k allocations per tick while holding the queue lock.This PR checks tasks where they are and only moves the ones whose state changes:
pendingThe resulting order of both lists is exactly the same as before, so scheduling behaviour does not change.
Benchmarks
BenchmarkFilterWaiting, 10k tasks, benchstat over 6 runs:Smaller queue sizes improve by a similar amount. The remaining allocations are the lookup map of queued task IDs.
Tests
TestFifoFilterWaitingTestFifoFilterWaitingKeepsUnchangedTasksInPlacechecks that unchanged tasks are not movedTestFifoFilterWaitingMatchesRequeueAllcompares the result with the previous algorithm on 500 random queues