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

[Bug]: Very slow restore when using NoWarn in single project that has lots of dependents #11222

Closed
jeffkl opened this issue Sep 8, 2021 · 1 comment · Fixed by NuGet/NuGet.Client#4475
Assignees

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Sep 8, 2021

NuGet Product Used

MSBuild.exe

Product Version

16.11

Worked before?

No response

Impact

I'm unable to use this version

Repro Steps & Context

When you have a large project tree with lots of transitive project references and packages, the calculation transitive NoWarn values takes forever. This code is attempting to search through transitive references:

https://github.com/NuGet/NuGet.Client/blob/5df07c3271aebfbeb86269d59a98d1acc9996670/src/NuGet.Core/NuGet.Commands/RestoreCommand/Logging/TransitiveNoWarnUtils.cs#L163

But in the debugger I found the queue to contain millions of items. This causing a massive amount of allocations which leads to GC pressure and makes restore very slow.

image

Workaround

Currently, the only way to work around the issue is to remove all NoWarn definitions in specific projects and instead specify them in a common import like Directory.Build.props so that every project has the exact same set of NoWarn. This makes the code not need to walk through recursively to determine NoWarn.

Verbose Logs

No response

@AAATechGuy
Copy link

AAATechGuy commented Feb 8, 2022

likely facing similar issue here.

    <NoWarn>NU1605</NoWarn>

After removing NoWarn from csproj, latency reduced from 1.2min to 5sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants