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

Add option to not write out dependency graph spec #14114

Open
jeffkl opened this issue Feb 19, 2025 · 0 comments
Open

Add option to not write out dependency graph spec #14114

jeffkl opened this issue Feb 19, 2025 · 0 comments
Labels
Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Tenet:Performance Performance issues Type:Feature

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Feb 19, 2025

NuGet Product(s) Involved

MSBuild.exe, dotnet.exe

The Elevator Pitch

After restore, NuGet writes out a dependency graph spec (dgspec) in the form of JSON. This file is only used in the scenario where you have loaded projects in a Visual Studio solution but a project that isn't loaded is referenced. In this case, NuGet loads the dgspec file to get information for restore.

However, in hosted build environments like Azure DevOps, there is no need to write this file since it isn't used. In a very large repository I tested out not writing this file and it reduced restore time by almost 20%.

We would not want to have this option on by default and instead would encourage people to set something based on their environment:

<PropertyGroup>
  <!-- Do not write out NuGet's dgspec file in our hosted build environment -->
  <RestoreWriteDependencyGraphSepc Condition="'$(ContinuousIntegrationBuild)' == 'true'">false</RestoreWriteDependencyGraphSepc>
</PropertyGroup>

Additional Context and Details

Relevant code is at https://github.com/NuGet/NuGet.Client/blob/72ab0e05562bc8e19db1ce0c2630a80e0bd3ca28/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreResult.cs#L205C19-L209

@jeffkl jeffkl added Triage:NeedsTriageDiscussion Type:Feature Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Tenet:Performance Performance issues and removed Triage:NeedsTriageDiscussion labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Tenet:Performance Performance issues Type:Feature
Projects
None yet
Development

No branches or pull requests

1 participant