Skip to content

[Bug]: Visual Studio Installed Packages page is slow to load #11923

@mjolka

Description

@mjolka

NuGet Product Used

Visual Studio Package Management UI

Product Version

Visual Studio 2022

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

The Installed packages page in the Visual Studio Package Management UI can be slow to load.

Part of the reason for this slowness is HttpClientHandler's MaxConnectionsPerServer setting, which by default is 2.

Increasing this value results in a much faster load time. In the attached video, setting MaxConnectionsPerServer to 20 reduces the time taken from ~42 seconds to ~14 seconds.

max.connections.per.server.mp4

This can be further improved by changing PackageMetadataResourceV3.GetMetadataAsync to make its API requests concurrently. In the attached video, the time taken is further reduced to ~5 seconds.

concurrent.metadata.mp4

The diff for these changes can be found here: mjolka/NuGet.Client@6da1317

This is the project file I used to test with:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="AWSSDK.Core" Version="3.7.12.3" />
    <PackageReference Include="AWSSDK.S3" Version="3.7.9.19" />
    <PackageReference Include="AWSSDK.SecretsManager" Version="3.7.2.59" />
    <PackageReference Include="AWSSDK.SecretsManager.Caching" Version="1.0.4" />
    <PackageReference Include="MassTransit" Version="8.0.3" />
    <PackageReference Include="MassTransit.RabbitMQ" Version="8.0.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.5" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
  </ItemGroup>

</Project>

Verbose Logs

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions