Add the ability to preload parts of the project system#80307
Merged
jasonmalinowski merged 2 commits intodotnet:mainfrom Sep 17, 2025
Merged
Conversation
This isn't doing anything interesting.
jasonmalinowski
commented
Sep 16, 2025
| uiContext.IsActive = this.CurrentSolution.Projects.Any(p => p.Language == language); | ||
| } | ||
|
|
||
| internal void PreloadProjectSystemComponents(string languageName) |
Member
Author
There was a problem hiding this comment.
More stuff may be added later here; the goal of this PR is mostly to get this in place so the preloader can be updated to take advantage of it. Once we get that under some perf traces we'll look at what else needs to be added here.
jasonmalinowski
commented
Sep 16, 2025
| Try | ||
| RegisterLanguageService(GetType(IVbCompilerService), Function() Task.FromResult(_comAggregate)) | ||
| AddService(GetType(IVbCompilerService), Function(_1, cancellationToken, _2) | ||
| PreloadProjectSystemComponents() |
Member
Author
There was a problem hiding this comment.
In the VB case, there's an explicit request for the service, so we can just add this without problems.
CyrusNajmabadi
approved these changes
Sep 16, 2025
For the csproj and msvbprj project systems, our COM services get called on the UI thread when project information is being sent our way. This has the side effect of creating all our "lazily created" MEF services on that UI thread during that time, which can result in more unnecessary blocking. Changing how those project systems work would be a hugely complicated change, but what we can do is take advantage of the preloading support that exists in VS to ensure we preload what we can off the UI thread before we hit the legacy code.
d3e916a to
95f7368
Compare
Member
Author
|
Waiting for an internal validation pass before merging this one. |
This was referenced Sep 19, 2025
This was referenced Sep 25, 2025
This was referenced Oct 27, 2025
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.
For the csproj and msvbprj project systems, our COM services get called on the UI thread when project information is being sent our way. This has the side effect of creating all our "lazily created" MEF services on that UI thread during that time, which can result in more unnecessary blocking. Changing how those project systems work would be a hugely complicated change, but what we can do is take advantage of the preloading support that exists in VS to ensure we preload what we can off the UI thread before we hit the legacy code.