-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Keep the solution pinned (on host and OOP) when making multiple calls between systems. #70765
Merged
Conversation
This file contains 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
dotnet-issue-labeler
bot
added
Area-IDE
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Nov 10, 2023
ToddGrun
approved these changes
Nov 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CyrusNajmabadi
commented
Nov 10, 2023
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.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1914915
Most times when a feature calls into OOP, it does so with a single message it wants to compute, against a particular solution snapshot. The OOP communication system ensures both the client and server are in sync with that solution snapshot, and it then runs the requested command on that snapshot. When the command returns, the OOP side is free to then drop that snapshot if nothing else is looking at it.
This can be a potential perf issue when a feature makes many calls to OOP against a particular snapshot. in the worst case, between each call, the OOP side may choose to drop the solution, forcing the differences between it, and the main solution to be resync'ed on each individual call, and causing things like compilations to drop away.
This PR changes a couple of places where we do this to use a simple utility class we have to keep a particular solution pinned for the scope where we are making several calls from the host to OOP. This ensure that the solution is not ever dropped on the OOP side for the duration of that scope, and that cache values (like compilations) can be reused from call to call.
Generally speaking, any features that make multiple calls to OOP with a single snapshot, should use this system.