-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,18 +27,12 @@ internal IComponentModel ComponentModel | |
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| _componentModel_doNotAccessDirectly = (IComponentModel?)await GetServiceAsync(typeof(SComponentModel)).ConfigureAwait(false); | ||
| Assumes.Present(_componentModel_doNotAccessDirectly); | ||
| } | ||
|
|
||
| protected override async Task OnAfterPackageLoadedAsync(CancellationToken cancellationToken) | ||
| { | ||
| await base.OnAfterPackageLoadedAsync(cancellationToken).ConfigureAwait(false); | ||
|
|
||
| // TODO: remove, workaround for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1985204 | ||
| var globalOptions = ComponentModel.GetService<IGlobalOptionService>(); | ||
| if (globalOptions.GetOption(SemanticSearchFeatureFlag.Enabled)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ protected AbstractPackage() | |
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(false); | ||
|
|
||
| await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,12 +144,10 @@ protected override void OnSaveOptions(string key, Stream stream) | |
|
|
||
| protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
| { | ||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(false); | ||
|
|
||
| await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); | ||
|
|
||
| cancellationToken.ThrowIfCancellationRequested(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| // Ensure the options persisters are loaded since we have to fetch options from the shell | ||
| LoadOptionPersistersAsync(this.ComponentModel, cancellationToken).Forget(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,8 +66,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic | |
|
|
||
| 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) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| Await MyBase.InitializeAsync(cancellationToken, progress).ConfigureAwait(False) | ||
|
|
||
| RegisterLanguageService(GetType(IVbCompilerService), Function() Task.FromResult(_comAggregate)) | ||
|
|
||
|
|
||
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.
RegisterService doesn't require main thread
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