-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Simple and safe performance changes to package load code. #77561
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
Simple and safe performance changes to package load code. #77561
Conversation
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); |
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.
|
|
||
| await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); | ||
|
|
||
| _componentModel_doNotAccessDirectly = (IComponentModel?)await GetServiceAsync(typeof(SComponentModel)).ConfigureAwait(true); |
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.
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); |
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.
|
|
||
| await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); | ||
|
|
||
| cancellationToken.ThrowIfCancellationRequested(); |
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.
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); |
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.
| try | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); | ||
| await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); |
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.
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.
do we need/want CA(true) on the prior line? if so, doc.
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.
no, we don't want that either, I just missed it in this PR. I'll go ahead and change.
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.
doc that as well plz
| Protected Overrides Async Function InitializeAsync(cancellationToken As CancellationToken, progress As IProgress(Of ServiceProgressData)) As Task | ||
| Try | ||
| Await MyBase.InitializeAsync(cancellationToken, progress).ConfigureAwait(True) | ||
| Await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken) |
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.
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.
do we need/want CA(true) on the prior line? if so, doc.
CyrusNajmabadi
left a comment
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.
signing off. but i think it wouild be good for these critical sections to doc the intentional behavior here.
Agreed, I will add some documentation once things get a little closer to the end target. |
| _componentModel_doNotAccessDirectly = (IComponentModel?)await GetServiceAsync(typeof(SComponentModel)).ConfigureAwait(true); | ||
| _componentModel_doNotAccessDirectly = (IComponentModel?)await GetServiceAsync(typeof(SComponentModel)).ConfigureAwait(false); | ||
| Assumes.Present(_componentModel_doNotAccessDirectly); | ||
|
|
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: feel free to do in a follow up
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.
whoops! I had a whole bunch of logging that I was using for local verification, and looks like I didn't remove the newline that I had next to it.
This is the 2nd part of a multi-part PR series focused on improving the performance of loading the roslyn packages.
This PR focuses mostly on removing some extraneous potential thread switches.
Part 1: #77439