Skip to content
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

UI Delay - [PerfWatson] UIDelay: microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.Invoke|nuget.visualstudio.implementation.dll!NuGet.VisualStudio.PumpingJTF.WaitSynchronously #8892

Open
Tracked by #8872
nkolev92 opened this issue Dec 9, 2019 · 3 comments
Labels
Functionality:SDK The NuGet client packages published to nuget.org Partner:Roslyn Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug

Comments

@nkolev92
Copy link
Member

nkolev92 commented Dec 9, 2019

There's a UI delay happening when the editor suggests a package to be installed.

There are 2 obvious issues here:

  1. We have a synchronous API which blocks the calling thread.
  2. We are being invoked on the UI thread, which we can't blame others for because frequently IVS sync APIs are invoked on the UI thread.

The correct solution here is an async VS Package Installer service.

microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.Invoke 91.8%
microsoft.visualstudio.languageservices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitIndicator.Wait 91.4%
microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction+<>c__DisplayClass_0.b__ 91.4%
microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InnerInvoke 91.4%
microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeCore 91.4%
microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction+<>c__DisplayClass_0.b__ 91.4%
microsoft.codeanalysis.editorfeatures.wpf.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker 91.2%
microsoft.codeanalysis.editorfeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.Apply 76.8%
microsoft.codeanalysis.editorfeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ProcessOperations 76.6%
microsoft.codeanalysis.features.dll!Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`+InstallPackageAndAddImportOperation[System.__Canon].TryApply 74.8%
microsoft.codeanalysis.features.dll!Microsoft.CodeAnalysis.AddPackage.InstallPackageDirectlyCodeActionOperation.TryApply 74.8%
microsoft.visualstudio.languageservices.dll!Microsoft.VisualStudio.LanguageServices.Packaging.PackageInstallerService.TryInstallPackage 74.8%
microsoft.visualstudio.languageservices.dll!Microsoft.VisualStudio.LanguageServices.Packaging.PackageInstallerService.TryInstallAndAddUndoAction 74.8%
microsoft.visualstudio.languageservices.dll!Microsoft.VisualStudio.LanguageServices.Packaging.PackageInstallerService.TryInstallPackage 74.8%
nuget.visualstudio.implementation.dll!NuGet.VisualStudio.VsPackageInstaller.InstallLatestPackage 67%
nuget.visualstudio.implementation.dll!NuGet.VisualStudio.VsPackageInstaller.InstallPackage

Related: #8842

Internal issue: 959448

@nkolev92
Copy link
Member Author

The solution here is to not call this API on the UI thread.
However, IVS sync APIs are called from the UI thread as a pattern.

The NuGet side of the fix is: #8896
Keeping this one tracking for the partner side usage of new service.

@nkolev92 nkolev92 added Functionality:SDK The NuGet client packages published to nuget.org and removed NuGet API labels Apr 24, 2020
@nkolev92 nkolev92 added the Priority:2 Issues for the current backlog. label May 20, 2020
@nkolev92 nkolev92 removed their assignment May 20, 2020
@nkolev92
Copy link
Member Author

nkolev92 commented Jul 3, 2020

Lots of work was already started here.

@nkolev92 nkolev92 removed this from the Sprint 173 - 2020.07.06 milestone Jul 20, 2020
@nkolev92 nkolev92 added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Priority:2 Issues for the current backlog. labels Aug 15, 2020
@nkolev92
Copy link
Member Author

pri3 per discussions with @aortiz-msft

@nkolev92 nkolev92 added Priority:2 Issues for the current backlog. and removed Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. labels May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:SDK The NuGet client packages published to nuget.org Partner:Roslyn Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug
Projects
None yet
Development

No branches or pull requests

2 participants