Skip to content
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

🐇 Avoid costly calls to GetAllStateSets inside ContainsDiagnostics #54401

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

sharwell
Copy link
Member

Fixes #54400

@sharwell sharwell requested a review from a team as a code owner June 25, 2021 21:39
Comment on lines +69 to +70
return _stateManager.HasAnyHostStateSet(static (stateSet, arg) => stateSet.ContainsAnyDocumentOrProjectDiagnostics(arg), projectId)
|| _stateManager.HasAnyProjectStateSet(projectId, static (stateSet, arg) => stateSet.ContainsAnyDocumentOrProjectDiagnostics(arg), projectId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the best order for these tests? I'm not familiar with the contents of the data collections here, but HasAnyProjectStateSet has only one level of looping, while HasAnyHostStateSet has two.

Copy link
Member Author

@sharwell sharwell Jun 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain which order is best, but I believe the current order matches what the prior implementation used. For the expected/target case, this method would return false, implying both paths are used.

@sharwell sharwell changed the title Avoid costly calls to GetAllStateSets inside ContainsDiagnostics 🐇 Avoid costly calls to GetAllStateSets inside ContainsDiagnostics Jun 26, 2021
@sharwell sharwell enabled auto-merge June 28, 2021 21:35
@sharwell sharwell merged commit d12580c into dotnet:main Jun 29, 2021
@ghost ghost added this to the Next milestone Jun 29, 2021
@sharwell sharwell deleted the faster-state-sets branch June 29, 2021 01:01
@RikkiGibson RikkiGibson modified the milestones: Next, 17.0.P2 Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetAllHostStateSets allocates large amounts of data when loading giant solutions
4 participants