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

PackageSpecWriter is calling Any on an ICollection<T>/IList<T> instances instead of .Count #13213

Closed
jeffkl opened this issue Feb 2, 2024 · 1 comment · Fixed by NuGet/NuGet.Client#5629
Assignees
Labels
PerfWins Priority:2 Issues for the current backlog. Tenet:Performance Performance issues Type:Bug
Milestone

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Feb 2, 2024

NuGet Product Used

MSBuild.exe, NuGet.exe

Product Version

All

Worked before?

No response

Impact

None

Repro Steps & Context

The PackageSpecWriter class calls the .Any() method on some IList<T> objects which causes allocations. These should be avoided on hot paths.

Verbose Logs

No response

@jeffkl
Copy link
Contributor Author

jeffkl commented Feb 13, 2024

Fixed by #13213

@jeffkl jeffkl closed this as completed Feb 13, 2024
@jeffkl jeffkl added this to the 6.10 milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PerfWins Priority:2 Issues for the current backlog. Tenet:Performance Performance issues Type:Bug
Projects
None yet
1 participant