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

ResolvedDependencyKey should be struct to reduce memory allocations #13138

Closed
jeffkl opened this issue Jan 8, 2024 · 0 comments · Fixed by NuGet/NuGet.Client#5568
Closed
Labels
Category:BreakingChange PerfWins Priority:2 Issues for the current backlog. Type:DCR Design Change Request
Milestone

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Jan 8, 2024

The NuGet.Commands.ResolvedDependencyKey class is allocated a lot during dependency resolution and instead could be a struct which would reduce memory usage. This would be a breaking change for any user who is using the API. This is a list of the public APIs that will change:

NuGet.Commands.ResolvedDependencyKey.Equals(NuGet.Commands.ResolvedDependencyKey other) -> bool
NuGet.Commands.ResolvedDependencyKey.ResolvedDependencyKey() -> void
static NuGet.Commands.ResolvedDependencyKey.operator !=(NuGet.Commands.ResolvedDependencyKey left, NuGet.Commands.ResolvedDependencyKey right) -> bool
static NuGet.Commands.ResolvedDependencyKey.operator ==(NuGet.Commands.ResolvedDependencyKey left, NuGet.Commands.ResolvedDependencyKey right) -> bool

Also, the NuGet.Commands.UnexpectedDependencyMessages was removed from the public API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:BreakingChange PerfWins Priority:2 Issues for the current backlog. Type:DCR Design Change Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants