Home: PM UI: installed packages fetched 4 times per project

Created on 4 Dec 2020  路  3Comments  路  Source: NuGet/Home

Setup steps:

  1. Create a new C# class library project.
  2. Open PM UI.
  3. In the Browse tab, select the first package and install it.
  4. Save and close the solution.

Repro steps:

  1. Open the solution.
  2. In Solution Explorer, right-click on the project and select "Manage NuGet Packages..."

Expected result: INuGetProjectManagerService.GetInstalledPackagesAsync(...) will be called once per project.

Actual result: INuGetProjectManagerService.GetInstalledPackagesAsync(...) is called 4 times for 1 project.

Unique callstacks (in call order):

  1. NuGet.PackageManagement.UI.PackageManagerControl.PackageManagerLoaded(object sender, System.Windows.RoutedEventArgs e)
  2. NuGet.PackageManagement.UI.PackageItemLoader.UpdateStateAndReportAsync(NuGet.PackageManagement.VisualStudio.SearchResult<NuGet.Protocol.Core.Types.IPackageSearchMetadata> searchResult, System.IProgress<NuGet.PackageManagement.UI.IItemLoaderState> progress, System.Threading.CancellationToken cancellationToken)
  3. NuGet.PackageManagement.UI.PackageManagerControl.RefreshInstalledAndUpdatesTabs()
  4. NuGet.PackageManagement.VisualStudio.UpdatePackageFeed.GetPackagesWithUpdatesAsync(string searchText, NuGet.Protocol.Core.Types.SearchFilter searchFilter, System.Threading.CancellationToken cancellationToken)
Backlog VS.Client VS.Oe Performance Bug

Most helpful comment

I am not blocked on this.

I think this can be tackled independently of CodeSpaces; however, both standalone and CodeSpaces-connected clients stand to benefit significantly from reducing this down to 1 call. If you have _n_ projects in your solution, making 4 _n_ calls won't scale performantly.

All 3 comments

FYI @donnie-msft, @erdembayar, @sbanni, @rrelyea

@dtivel I was just chatting with @jebriede about the unnecessary RefreshInstalledAndUpdatesTabs call.
...yes, our UI isn't particularly efficient today. We have several refactoring efforts ongoing to improve this.

Is this just an "FYI" issue, or are you blocked? Is it overtly hurting CodeSpace work or anything?

I am not blocked on this.

I think this can be tackled independently of CodeSpaces; however, both standalone and CodeSpaces-connected clients stand to benefit significantly from reducing this down to 1 call. If you have _n_ projects in your solution, making 4 _n_ calls won't scale performantly.

Was this page helpful?
0 / 5 - 0 ratings