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

Await WhenNominated when a project has a pending nomination #11132

Closed
nkolev92 opened this issue Aug 5, 2021 · 0 comments · Fixed by NuGet/NuGet.Client#4184
Closed

Await WhenNominated when a project has a pending nomination #11132

nkolev92 opened this issue Aug 5, 2021 · 0 comments · Fixed by NuGet/NuGet.Client#4184
Assignees
Labels
Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug

Comments

@nkolev92
Copy link
Member

nkolev92 commented Aug 5, 2021

Visual Studio Version:
17.0 preview 3

Summary:

IVsProjectRestoreInfoSource.WhenNominated is not awaited so it returns immediately.

This basically causes NuGet to have to invoke WhenNominated multiple times on the same project.

This basically leads to NuGet not being able to accurately reason about the effectiveness of the batching, as it pollutes the data with a high number of checks.

NuGet still gets to batch the restores, but there are caveats.

  • What is currently happening is effectively busy spin. A threadpool is blocking doing a large amount of work.
  • It's technically still more effective than what was happening before, but we're pay more than we need to.

To fully understand what's going on, I added the following logging: https://github.com/NuGet/NuGet.Client/compare/dev-nkolev92-logging?expand=1.

I have added the logs at the bottom.

Steps to Reproduce:

  1. Clone https://github.com/NuGet/NuGet.Client
  2. Checkout dev-nkolev92-testBranchSwitch on the commandline.
  3. Load NuGet-Src-Commandline.slnf and observe 1 restore.
  4. Branch switch to dev-nkolev92-testBranchSwitch2 in Visual Studio and observe 1 restore.
  5. The branch differences can be observed at NuGet/NuGet.Client@dev-nkolev92-testBranchSwitch2...dev-nkolev92-testBranchSwitch

You can observe the vs/nuget/restoreinformation telemetry and see that ProjectsReadyCheckCount is 100+ instead of the expected 2.

cc @ocallesp @lifengl
RestoreCheckLogs.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant