Repository navigation
gh extension list is very slow #4220
Description
Activity
Listing extensions is slow because it checks on GitHub for every extension whether it has updates (i.e. has newer commits pushed)
cli/pkg/cmd/extension/manager.go
Lines 104 to 107 in 99cbfd3
if includeMetadata { remoteUrl = m.getRemoteUrl(f.Name()) updateAvailable = m.checkUpdateAvailable(f.Name()) } We could probably speed it up by avoiding doing this check too often.
- addedpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
on Aug 30, 2021 We could probably speed it up by avoiding doing this check too often.
IMO the default behavior should be to not do this check by default, and maybe print a message if the last check was too long ago, suggesting the user to run
gh extension list --check(or whatever other flag name would be acceptable). That way, the slow behavior would be opt-in and deterministic, rather than "smartly" snuck in in some invocations of the command and not in others.Reacted by Benjamin Chadwick and atusyHey @samcoe — I have had the chance to test gh 2.1.0, but even with this check for updates now done concurrently (thanks to #4396), it is still taking me several seconds to see the output (even more than before, ironically — although of course network latency variations will affect the results). As the original reporter, I would not consider this issue resolved until the times are much closer to a plain listing of
~/.local/share/gh/extensions/. Please reopen the issue.@waldyrious Thanks for the update that you are still experiencing this issue. I will reopen it. As next steps for speeding this up I think the only real option is to try to reduce the number of network requests. Two options there are to do caching and only checking for updates every 24hr (for example) or introducing a flag that specifies that
extension listshould or shouldn't check for updates as you mentioned in your previous comment. We could also do a combination of both where the new flag will force a update check otherwise only check for updates on a specified interval.Reacted by Waldir Pimenta
Describe the bug
Listing the installed extensions seems to be extremely slow.
Steps to reproduce the behavior
I can replicate this multiple times.
Expected vs actual behavior
Since the extensions are installed locally, I'd expect the listing of installed extensions to be very fast, e.g.
Maybe there should be a command-line option to toggle whatever slow step is taking place when listing the extensions?