[6.0] Fix quadratic performance of the ListMerger in specific usage pattern #74112
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.
Description: Default actors used to use a ListMerger to manage the items and their priority in the queue; Under contention, this list merging was causing very noticeable performance degradation. Instead this PR introduces a new priority queue which manages a number of independent queues for each priority, removing the need for the "merging".
Scope/Impact: Impacts all default actor implementations.
Risk: Moderate, the change affects all default actors but has been thoroughly tested and reviewed by multiple people.
Testing: CI testing.
Reviewed by: @ktoso @rjmccall @mikeash
Original PR: #73998 (originally #70910)
Radar: rdar://114953765