Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Slow completion when using aptitude

On Jan 26,  3:55pm, Frank Terbeck wrote:
} Subject: Re: Slow completion when using aptitude
} The difference is, that "aptitude install <tab>" lists uninstalled
} packages, whereas "apt-get install <tab>" simply lists all available
} packages. The former, while being more appropriate, also takes more
} work.

I tried this completion on a system that has neither aptitude nor
apt-get installed at all, so that I could limit the differences to
those attributable directly to the zsh completion system.

Comparing _complete_debug output for the two, the main difference
seems to be that _aptitude passes through _deb_packages repeatedly
if you have a matcher-list, while _apt makes only a single pass.
Both start out by looking at the DEBS_avail cache, but _aptititude
then goes on to examine the DEBS_installed cache as well, which
seems like a missed optimization in the case of this particular
sub-command word.

} I must admit, that I'm not quite familiar with how compsys' caching is
} implemented. I may be giving wrong pointers here. So I should better
} be quiet.

The caching appears to be identical in both cases, they're both going
through the standard mechanism; in fact even with the commands not
installed, if I repeat the aptitude completion and compare the
_complete_debug output, the (empty) cache is used and most of the
work done in _deb_packages on the first attempt is avoided.

If the cache doesn't seem to persist across session exit/restart, it
must have something to do with how cache validity is determined.


Messages sorted by: Reverse Date, Date, Thread, Author