Skip to content

[6.0] Fix quadratic performance of the ListMerger in specific usage pattern #74112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jun 4, 2024

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

@ktoso ktoso requested a review from a team as a code owner June 4, 2024 04:48
@ktoso
Copy link
Contributor Author

ktoso commented Jun 4, 2024

@swift-ci please test

@ktoso ktoso added performance concurrency Feature: umbrella label for concurrency language features 🍒 release cherry pick Flag: Release branch cherry picks labels Jun 4, 2024
@ktoso ktoso merged commit e6cb5f4 into swiftlang:release/6.0 Jun 4, 2024
5 checks passed
@ktoso
Copy link
Contributor Author

ktoso commented Jun 4, 2024

Thanks again for the great work here @nickolas-pohilets, we managed to get it back to 6.0 :-)

@ktoso ktoso deleted the pick-optimize-actor-quadratic-perf-issue branch June 4, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency Feature: umbrella label for concurrency language features performance 🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants