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

Please cache package search results while doing update package for multiple projects in solution! #5401

Closed
TimLovellSmith opened this issue Jun 13, 2017 · 5 comments
Assignees
Labels
Functionality:Update The update package feature/command/experience Tenet:Performance Performance issues

Comments

@TimLovellSmith
Copy link
Member

Details about Problem

NuGet product used: VS UI

NuGet version (x.x.x.xxx): 3.5.01737

dotnet.exe --version (if appropriate): 1.0.0-preview2-003131 but does not apply for this scenario...

VS version (if appropriate): 2015 Update 3 (14.0.25431.01)

OS version (i.e. win10 v1607 (14393.321)): Server 2012 R2

Detailed repro steps so we can see the same problem

  1. I have a giant solution with lots of packages and I want to update Nuget package for Newtonsoft.Json, so I go into the manage Nuget Packages for solution and select Newtonsoft.Json in the update UX and choose version 9.0.1 which is the latest stable minor version for major version 9. Then I hit go...

  2. Problem: it takes too long! And I notice there's a particular inefficiency: the same HTTP requests are being done over and over again:

Attempting to gather dependency information for package 'Newtonsoft.Json.9.0.1' with respect to project [Project #1], targeting '.NETFramework,Version=v4.5'
GET https://api.nuget.org/v3/registration2-gz/newtonsoft.json/index.json
OK https://api.nuget.org/v3/registration2-gz/newtonsoft.json/index.json 69ms
GET https://api.nuget.org/v3/registration2-gz/windowsazure.storage/index.json
GET https://www.nuget.org/api/v2/FindPackagesById()?id='WindowsAzure.Storage'
GET https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/FindPackagesById()?id='WindowsAzure.Storage'

Attempting to gather dependency information for package 'Newtonsoft.Json.9.0.1' with respect to project [Project #2], targeting '.NETFramework,Version=v4.5.2'
GET https://api.nuget.org/v3/registration2-gz/newtonsoft.json/index.json
OK https://api.nuget.org/v3/registration2-gz/newtonsoft.json/index.json 231ms
snip
GET https://api.nuget.org/v3/registration2-gz/windowsazure.storage/index.json

Once its finished processing project #1 it does project #2 but its repeating the exact same HTTP requests here instead of using cached results - right?! GAAH no wonder this whole process takes like 15 minutes!

(And then to make matters worse it will also fail with errors about completely unrelated packages.. which I solve by temporarily commenting those packages out and doing it all again "One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages.")

@emgarten
Copy link
Member

@TimLovellSmith do you get the same result when running Update-Package Newtonsoft.Json -version 9.0.1 from the package manager console?

For a single command all feed data should be cached between projects, you shouldn't see multiple GET requests for the same URL. From your log it looks like this may have an issue.

@jainaashish
Copy link
Contributor

Cache key consists of package, source, and target framwork... since your target framework is different for project1 vs project2 so it repeated the call and get package dependencies for that specific target.

We can certainly improve this experience and improve our cache. Since first call itself will give all the details about package dependencies for each framework so we can always reuse that.

@jainaashish jainaashish self-assigned this Jul 6, 2017
@jainaashish jainaashish added this to the 4.4 milestone Jul 6, 2017
@jainaashish jainaashish added Tenet:Performance Performance issues Functionality:Update The update package feature/command/experience labels Jul 6, 2017
jainaashish added a commit to NuGet/NuGet.Client that referenced this issue Sep 19, 2017
We already have http cache working for packageReference based projects, this commit implements this http cache for packages.config based projects as well which will significantly improve install/ update performance.

Fixes: NuGet/Home#5401
jainaashish added a commit to NuGet/NuGet.Client that referenced this issue Oct 27, 2017
We already have http cache working for packageReference based projects, this commit implements this http cache for packages.config based projects as well which will significantly improve install/ update performance.

Fixes: NuGet/Home#5401
jainaashish added a commit to NuGet/NuGet.Client that referenced this issue Nov 14, 2017
We already have http cache working for packageReference based projects, this commit implements this http cache for packages.config based projects as well which will significantly improve install/ update performance.

Fixes: NuGet/Home#5401
@jainaashish jainaashish modified the milestones: 4.4, 4.6 - Nov14-Dec02 Nov 14, 2017
@TimLovellSmith
Copy link
Member Author

Me, my PC, and no doubt the NuGet.org servers thank you for attending to this issue!

@rrelyea
Copy link
Contributor

rrelyea commented Nov 14, 2017

@jainaashish - thanks for getting this done. is this now working for only v3 sources or both v2/v3? looking at titles of PRs/Commits, I see both listed.

@jainaashish
Copy link
Contributor

This is now working for both V2 and V3 sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Update The update package feature/command/experience Tenet:Performance Performance issues
Projects
None yet
Development

No branches or pull requests

4 participants