gentoo / gentoo-zsh-completions

[ORIGIN] Gentoo specific zsh completion support (ebuild, emerge, eselect, ...)
Other
36 stars 19 forks source link

improve performance when completing sets #6

Closed ff2000 closed 4 years ago

ff2000 commented 9 years ago

I think it is safe to assume that when I types "@" I want to complete sets. I don't know of any other completion that could start with "@". Currently it takes quite a lot of disk/cpu time when completing after an "@". I mostly need it for "@preserved-rebuild" which I like to type wrong. For the moment I use an alias to workaround preformance issues when completing sets.

msva commented 9 years ago

does it takes time every time you call emerge @ or only once? If first — then it is definitely depends on your ~/.zshrc.

ff2000 commented 9 years ago

It takes time every time. ~10 sec until the completion menu opens and further 10 sec to move the cursor into the menu. If I drop caches it adds ~10 secs to the first time I call it. As I usually don't emerge sets that often chances are big that caches got dropped already. I tried it as root with a custom zshrc and as user with prezto. both the same issue. Which settings could generate/fix that behaviour?

ff2000 commented 9 years ago

Another performance issue: emerge --list takes ~1min until I see completion suggestions. besides --list-sets it also showed up ktp-contact-list. Is there some fuzzy-search involved (see the double minus I typed)? emerge --set is faster (10 sec.) but it doesn't show up "--list-sets". emerge -li is instantaneous, but it reduces the list to short-cut options (which start with a single minus) It even gets worse when a completion is not found: emerge --with takes even longer to give me "-- no results --", would have expected --with-bdeps.

The reason I use completion is that I am not sure how exactly those options/sets/... are called. --list-sets or --sets? If I have to wait for such a long time I also can read the man page and search for the correct spelling of the option ;)

radhermit commented 6 years ago

Is this still an issue? It doesn't look like I can reproduce that significant of a delay, but we could double-check the pkg comp cache to make sure set info isn't getting reparsed on every comp call.

ff2000 commented 6 years ago

performance in general seems to be better. Completing sets takes about 3-4 seconds on my laptop now, the more powerful desktop is close to instantanious (with caches, dropped caches and it goes up to ~5 seconds). All other completions I tested last time also work faster, especially "--list" is 2-3 seconds opposed to the 1 minute. I can live with those numbers, if you think it's OK you can close this issue.