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

Winget List command takes 10 seconds to complete. #855

Closed
ghost opened this issue Apr 7, 2021 · 34 comments
Closed

Winget List command takes 10 seconds to complete. #855

ghost opened this issue Apr 7, 2021 · 34 comments
Labels
Area-Performance Issue related to CPU or memory performance Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@ghost
Copy link

ghost commented Apr 7, 2021

Steps to reproduce

winget list literally takes more or less than 10 seconds to print installed apps list.

Expected behavior

as a command line application, retrieving installed apps list should be instant.

Environment

Screenshot 2021-04-07 225708

@ghost ghost added the Needs-Triage Issue need to be triaged label Apr 7, 2021
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Performance Issue related to CPU or memory performance and removed Needs-Triage Issue need to be triaged labels Apr 7, 2021
@denelon
Copy link
Contributor

denelon commented Apr 7, 2021

@ecovio1 thanks for reporting this. It may be related to what we have to do to get the list of Apps from "Add/Remove Programs" and match them with the list of matching packages in the sources you have configured. Some work was done to speed this up, but there may still be more we can do.

@denelon denelon added this to the v.Next - Windows Package Manager milestone May 21, 2021
@Elias-Graf
Copy link

winget list actually takes even longer than 10s for me, roughly 24.

~\git> Measure-Command { winget list }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 24
Milliseconds      : 427
Ticks             : 244277791
TotalDays         : 0,000282728924768519
TotalHours        : 0,00678549419444444
TotalMinutes      : 0,407129651666667
TotalSeconds      : 24,4277791
TotalMilliseconds : 24427,7791

After that, it weirdly lists (what looks like) every program on my system, not just those installed with winget. I don't know if that's the desired result nor do I particularly mind it, especially if I can use it to uninstall everything on my system, but it would definitely be nice if it is somehow cached that result.

The output that the author posted, in case it is of any use:

~\git> winget features
The following experimental features are in progress.
They can be configured through the settings file 'winget settings'.

Feature                 Status   Property            Link
-----------------------------------------------------------------------------------
Microsoft Store Support Disabled experimentalMSStore https://aka.ms/winget-settings
Packaged API Support    Enabled  packagedAPI         https://aka.ms/winget-settings
~\git> winget --version
v1.0.11694
~\git> winget --info
Windows Package Manager v1.0.11694
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22000.168
Package: Microsoft.DesktopAppInstaller v1.15.11694.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Links
--------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
Licence Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget

Also for completeness sake: I'm using windows 11

@JohnMcPMS
Copy link
Member

@Elias-Graf , list is intended to show everything on the system (and uninstall is intended to allow you to interact with everything as well).

That is impressively long; I was thinking we should have caching when I was measuring ~600ms to resolve the localized names of the MSIX packages on the system. If you could provide a log file from the long running list command, I could start to look into exactly what is taking so long.

If you run winget list --verbose-logs then get the latest file from %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir it should hopefully point to where the time is being spent.

If you prefer, you can run winget list --verbose-logs then use Feedback Hub via http://aka.ms/winget-feedback and report the feedback id here.

@Masamune3210
Copy link

I have a lot of stuff installed and this install has been through all of 10 up to now, so it may just be something causing a issue but 791ms for a list seems egregious
image

@Masamune3210
Copy link

Apparently newstore was causing a lot of the issue, after disabling and removing it it drops down to 394 for me
image

@Elias-Graf
Copy link

@JohnMcPMS Well, some time elapsed and of course my system changed. E.g. restarted the computer, installed further windows 11 beta updates. And it looks like that resulted in the winget list command consistently taking roughly 1.5s. That is way more pleasant, if not acceptable. Although it has to be said that at the time of writing this comment I'm facing #1437.

If it gets worse I will get back to you, and if you still want the debug output please get back to me 😊.

@pcbeard
Copy link

pcbeard commented Sep 9, 2021

Using winget source remove newstore is a good workaround for #1437, and it seems to have sped up winget list.

@JohnMcPMS
Copy link
Member

This should be fixed by our more recent pre-release packages, assuming that the vast majority of extreme times was due to the msstore source. In particular, v1.0.12576 is the first to have the fix.

Generally we do need to improve the behavior in this area long term, likely via a caching mechanism of some kind. Alternately (really, in addition to) we could remove the upgrade availability indicators from list to improve performance. Now that we have upgrade it might make sense to do so, but probably not before the caching is in place due to the implementation details.

@JohnMcPMS JohnMcPMS added the Needs-Author-Feedback Issue needs attention from issue or PR author label Sep 23, 2021
@denelon denelon added this to WinGet Sep 29, 2021
@ghost ghost added the No-Recent-Activity Issue has no recent activity label Sep 30, 2021
@ghost
Copy link

ghost commented Sep 30, 2021

@ghost this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@denelon denelon modified the milestones: v.Next-Client, v1.2-Client Oct 1, 2021
@ghost ghost removed the No-Recent-Activity Issue has no recent activity label Oct 1, 2021
@ghost ghost added the No-Recent-Activity Issue has no recent activity label Oct 9, 2021
@ghost
Copy link

ghost commented Oct 9, 2021

@ghost this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost
Copy link

ghost commented Oct 15, 2021

@msftbot this issue shall not be closed. It's EXACTLY SAME now in October as it was in April >_<

@ghost ghost removed the No-Recent-Activity Issue has no recent activity label Oct 15, 2021
@denelon
Copy link
Contributor

denelon commented Oct 19, 2021

What version of the client are you currently running on? Can you share the output from winget --info?

Which sources do you have configured?

@denelon denelon added this to the v1.4-Client milestone May 31, 2022
@denelon
Copy link
Contributor

denelon commented Aug 9, 2022

Some improvements have been made in this area for the 1.3 release. There may still be improvements that need to be made in the future if users are encountering this performance issue.

Let me know if this is still happening.

@denelon denelon added the Needs-Author-Feedback Issue needs attention from issue or PR author label Aug 9, 2022
@ghost ghost added the No-Recent-Activity Issue has no recent activity label Aug 16, 2022
@ghost
Copy link

ghost commented Aug 16, 2022

@ghost this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@denelon denelon moved this from Assigned to To Do in WinGet Aug 19, 2022
@vedantmgoyal9
Copy link
Contributor

@denelon The user who has posted the issue has deleted the account. This can be closed for now, and if there will be any issue, there is always an option to create a new issue.

@ghost ghost removed the No-Recent-Activity Issue has no recent activity label Sep 19, 2022
@denelon
Copy link
Contributor

denelon commented Sep 19, 2022

@vedantmgoyal2009 we have some ideas on what is causing the performance problem in some cases. We're going to keep this open until we've had a chance to improve the performance (at least in that specific case).

@ghost ghost added the No-Recent-Activity Issue has no recent activity label Sep 26, 2022
@ghost
Copy link

ghost commented Sep 26, 2022

@ghost this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@denelon denelon modified the milestones: v1.4-Client, v1.5-Client Dec 28, 2022
@ghost ghost removed the No-Recent-Activity Issue has no recent activity label Dec 28, 2022
@ghost ghost added the No-Recent-Activity Issue has no recent activity label Jan 4, 2023
@ghost
Copy link

ghost commented Jan 4, 2023

@ghost this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@Karl-WE
Copy link
Contributor

Karl-WE commented Jan 7, 2023

If winget relies on cim / wmi it is quite naturally slow based on CPU type and number of apps.

If you run a query via PowerShell it should be the same.

@ghost ghost removed the No-Recent-Activity Issue has no recent activity label Jan 7, 2023
@denelon denelon removed the Needs-Author-Feedback Issue needs attention from issue or PR author label Jan 9, 2023
@denelon denelon modified the milestones: v1.5-Client, v.Next-Client Apr 18, 2023
@denelon denelon removed this from WinGet Jun 13, 2023
@denelon denelon modified the milestones: v.Next-Client, v1.6 Client Jul 11, 2023
@denelon
Copy link
Contributor

denelon commented Jul 11, 2023

The issue related to correlation attempts to the "msstore" REST source has been addressed.

@denelon denelon closed this as completed Jul 11, 2023
@arcyc
Copy link

arcyc commented Sep 25, 2023

10 seconds? Lucky! I'm up to 300 seconds on my machine with 400Mbs internet. Pretty sure it's throttling requests on the back end source calls, which is silly since it's a command you run locally to get a list of installed apps on your system, and the backend call are purely incidental. I should be able to run winget list and winget upgrade --all as often as I want locally without throttling on the backend. If the CDN isn't throttling, then there is something seriously wrong with the performance of the backend services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Issue related to CPU or memory performance Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

10 participants