-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add the ability to preload parts of the project system #80307
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
Add the ability to preload parts of the project system #80307
Conversation
This isn't doing anything interesting.
| uiContext.IsActive = this.CurrentSolution.Projects.Any(p => p.Language == language); | ||
| } | ||
|
|
||
| internal void PreloadProjectSystemComponents(string languageName) |
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.
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.
| Try | ||
| RegisterLanguageService(GetType(IVbCompilerService), Function() Task.FromResult(_comAggregate)) | ||
| AddService(GetType(IVbCompilerService), Function(_1, cancellationToken, _2) | ||
| PreloadProjectSystemComponents() |
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.
In the VB case, there's an explicit request for the service, so we can just add this without problems.
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
|
Waiting for an internal validation pass before merging this one. |
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.