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 should write out original string for versions instead of allocating a new one #13183

Closed
jeffkl opened this issue Jan 23, 2024 · 1 comment
Assignees
Labels
PerfWins Priority:2 Issues for the current backlog. Tenet:Performance Performance issues Type:Bug
Milestone

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Jan 23, 2024

NuGet Product Used

MSBuild.exe, dotnet.exe

Product Version

All

Worked before?

No response

Impact

None

Repro Steps & Context

The SetCentralDependencies method writes out the PackageVersion items to the project.assets.json and uses the normalized version. This section is only read by our reader which parses it again during read so there's no need to allocate another string and instead should just write out the original string.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.ProjectModel/PackageSpecWriter.cs#L668

Originally reported internally: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1828422

Verbose Logs

No response

@jeffkl jeffkl added PerfWins Priority:2 Issues for the current backlog. Tenet:Performance Performance issues Type:Bug labels Jan 23, 2024
@jeffkl jeffkl changed the title PackageSpecWriter should write out original string for versions instead of allocating a new one (1.4% of high-GC sessions, 152 MB/s at worst) PackageSpecWriter should write out original string for versions instead of allocating a new one Jan 23, 2024
@jeffkl jeffkl self-assigned this Jan 23, 2024
@jeffkl
Copy link
Contributor Author

jeffkl commented Feb 2, 2024

Fixed in NuGet/NuGet.Client#5619

@jeffkl jeffkl closed this as completed Feb 2, 2024
@kartheekp-ms kartheekp-ms added this to the 6.10 milestone May 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
Development

No branches or pull requests

2 participants