-
Notifications
You must be signed in to change notification settings - Fork 903
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
install/upgrade/outdated - improve performance and optimize queries #1397
Comments
@wickles yes, it's on our list to implement package indexes. That is why when you run |
If you think it's bad now, you never had to work with the old Posh version of Choco - it was more like 40 minutes. Really, really bad. We've been talking about adding package indexes since 2014. https://www.slideshare.net/ferventcoder/chocolatey-puppet-conf2014/27 |
Am I allowed to kindly be vocal about this slowiness here? It bugs me quite some time every time I use choco, any command it is soooo slow :(
|
@dionysius head to the logs folder and take a look at the timing of the output of each log message. Even better, post it to a gist and share that here. That will help us see what may be causing things to be slow for you. That is a very long time to be waiting on a command and definitely not normal. It's not quite the same as this issue, as |
The chocolatey.log file by the way, not the summary. |
Hi @ferventcoder, didn't expected that quick response. While my issue is a general issue, I'll better raise a separate issue for that. But maybe I can help a little for the time beeing, I can contribute to this exact named issue I've encounter also for
(I'm aware why npcap isn't listed anymore, there's a thread for it elsewhere) The gist of chocolatey.log: https://gist.github.com/dionysius/c973f254355b04d349e6c9124993e89a And in theory my computer and network is not potato :) |
It takes 45-48 seconds for choco outdated to give me results as well. I've noticed a considerable slowdown in choco processing after the version header for some time. I believe it goes back to when the manifest issue was changed back to not requiring elevated rights. |
Oh, good to know. All my commands are in elevated cmd already, otherwise the "auto confirmation" would not apply. (I think it's the option called "allowGlobalConfirmation", but It was long time ago I activated that) Edit: And maybe it is how it is then - if so, I just like to let you know that there are wishes for improvement :) |
I retract my statement about all choco command being slow. There was a point that it seemed that way, but I think it went away with 10.7 or 10.8. @dionysius - thanks for the clue on ptime. I like it. I used to use the timer function in 4DOS a lot and needed a replacement since I haven't used 4DOS in years. just for comparisonptime 1.0 for Win32, Freeware - http://www.pc-tools.net/ === choco outdated === irfanviewshellextension|1.04|1.04|false Chocolatey has determined 1 package(s) are outdated.
Execution time: 78.027 s |
I only have 34 packages and |
Choco outdated is always going to be dependent on the network, at least until pkg indexes are implemented and even then in some way when the indexes update. |
Added get_outdated to NugetService for simplification. "packageManager.SourceRepository.FindPackage" downloaded data about all versions of package instead of only the latest. Now "packageManager.SourceRepository.GetPackages()" is used that gets only the latest version of a package.
…pported." when using remote repository.
Fixed naming IsRepositoryRemote to repository_is_remote. Call .ToList() on GetPackages() to prevent warning from nugget.
chocolatey#1398 IgnoreUnfoundPackagesOnUpgradeOutdated The .ToLower() is not needed.
…urn the latest version.
Added get_outdated to NugetService for simplifiation. "packageManager.SourceRepository.FindPackage" downloaded data about all versions of a package instead of only the latest. Now "packageManager.SourceRepository.GetPackages()" is used to get only the latest version of a package.
Ensure the config is reset to a known point with each package being run in an operation. Previously it was thought this was happening, but the way the reset occurred was actually changing the original configuration and the current. Ensure that is getting reset accordingly by doing the deep copy to set config each time through.
Search through each repo based on features, instead of looking at only what all in aggregate have available. This allows searching for prereleases when available even if not every repo supports them.
* stable: (chocolateyGH-1397) Search each repo based on features (chocolateyGH-1397) Fix: Ensure config reset (chocolateyGH-1656) Ensure check is not case sensitive
This has been completed to speed up queries - this is available now in the beta ( |
Can see the improvement :)
Compared to my earlier try (should be the same package list) it has at almost halved 👍 (107s down to 68s) |
Nice. Thanks for the update! |
choco outdated
is slowchoco outdated
When attempting packaging operations like install/upgrade and a repositories fails, log a warning and continue on. #612 implemented some of the fixes for ignoring failing repositories, but apparently that didn't apply when querying those repositories outside of the package manager that was implemented with #1397.
choco outdated
When searching for packages based on id, instead of using the older methods, use the optimizations if they are turned on in the configuration. This follows chocolateyGH-1397 to ensure that info uses the same algorithm.
I know this is an old issue but it raises some questions...
Currently
Instead, consider one consolidated request such as... Example returned information: {
"audacity": "3.0.5",
"autohotkey": "1.1.33.10",
"ccleaner": "5.86.9258"
} I realize this would take some additional work on the server side, but it would
In addition, the amount of data returned by the API seems unnecessary for simple operations such as Example query - 6 KB of data Considering each request returns an average of 6 KB of data... I have 193 packages... so it transfers 1.158 MB, which isn't a huge deal in terms of size, but having to process 193 GET requests of 6 KB each...takes a little bit, and for certain functions such as Even if the team didn't want to implement a multi-package search in the API, an alternative solution would be:
Perhaps there is a backstory I am unaware of, or perhaps this is available in the business version (I only use it for personal use), but I happened to be Googling about this topic and came across this issue. Thoughts? Thank you guys for all the work you do on Chocolatey! |
Fell free to hide this comment as this won't contribute to the issue. I was forced to switch to another package manager called scoop because of this and I'm very happy with it. |
@asheroto This issue is closed. Can you please open a new issue. |
No prob! 🙂 |
I'm not sure which issue is solved now, but the "choco upgrade all" command became really fast in "chocolatey v2.2.0" :) Thank you :) |
Performance improvements were made in 2.1.0 and this issue helps |
Don't know if this is expected behavior or it's just my system, but
choco outdated
always takes a good 45 seconds to run fully, with 136 packages installed. It seems like it's querying for new data for each package, every time. Most package managers have amypacman update
style command to update a local cache of complete package data all at once, so that we don't need to query every package every time, and this command itself is generally much quicker thanchoco outdated
for other package managers. It would be great if we could get a similar feature or some other way to speed upchoco outdated
.NOTE: Added by admin.
Seeing Errors in New Versions of Choco?
If you find this causes issues with your repository of choice, please see #1770
Known Affected Servers include LaGet and NuGet Simple Server (PHP). Please see #1770 for those items as that is where that will be updated.
Release Notes
So we've implemented some optimizations for install/upgrade/outdated on getting packages. It is largely seen in outdated, where it is an order of magnitude faster (but it also has the most queries).
For Chocolatey v0.10.12+, we have converted to a much more efficient way of finding packages that allows us to reduce bandwidth and really speed things up. To do so, it means a change from
FindPackagesById()
toPackages()
with a filter when we have aDataServicePackageRepository
(aka a NuGet OData Package Repository Atom Feed).The prior method
FindPackagesById()
would return ALL versions of a package and then locally choco/NuGet would filter them. This as you know can cause multiple queries if you have a lot of versions of a package, and some really inefficient use of resources and time. Moving toPackages()
filtering by package Id and the latest version available means 1 result is returned. It's quite efficient and quite a bit faster than the older method by an order of magnitude.Outdated Measurements
choco outdated
makes heavy use of calling for upgraded versions. I have a system with about 34 packages installed.Chocolatey 0.10.11 -
Measure-Command { choco outdated -r --ignore-unfound }
Chocolatey 0.10.13 -
Measure-Command { choco outdated -r --ignore-unfound }
That's over 100% faster if I can math correctly.
The text was updated successfully, but these errors were encountered: