-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Optimize work done in ProjectCodeModelFactory #78369
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
Optimize work done in ProjectCodeModelFactory #78369
Conversation
1) Change the ABWQ to hold WorkspaceChangeEventArgs. By doing this, we don't need to calculate the solution/project changes before placing items in the queue. 2) Ensure _visualStudioWorkspace.GetFilePath is done from a bg thread
| var stopwatch = SharedStopwatch.StartNew(); | ||
| foreach (var documentId in documentIds) | ||
| // Fire off the code model events while on the main thread | ||
| await FireEventsForChangedDocumentsAsync(projectCodeModelAndFileNames, cancellationToken).ConfigureAwait(false); |
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.
nit: since this method is async, you can move the STMTA into it.
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.
I actually kind of preferred it in the outer method, as that's what's done for the background thread assurance. This way, if more work needs to be done on the main thread, it can just be called from the same section in ProcessNextWorkspaceChangeEventBatchAsync.
src/VisualStudio/Core/Impl/CodeModel/ProjectCodeModelFactory.cs
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| nextInputCheckElapsedMs = elapsedMs + 1; | ||
| } |
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.
i assume this logic was the same as before.
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.
This logic changed, as IsInputPending showed up in the profiles
Change the ABWQ to hold WorkspaceChangeEventArgs. By doing this, we don't need to calculate the solution/project changes before placing items in the queue.
Ensure _visualStudioWorkspace.GetFilePath is done from a bg thread
Test insertion PR: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/631967
*** old CPU under ProjectCodeModelFactory ***

*** old allocs under ProjectCodeModelFactory ***

*** new CPU under ProjectCodeModelFactory ***

*** new allocs under ProjectCodeModelFactory ***
