From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28290 invoked by alias); 26 Jan 2011 17:05:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28660 Received: (qmail 23681 invoked from network); 26 Jan 2011 17:05:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110126090508.ZM2111@torch.brasslantern.com> Date: Wed, 26 Jan 2011 09:05:06 -0800 In-reply-to: <87d3njemu9.fsf@ft.bewatermyfriend.org> Comments: In reply to Frank Terbeck "Re: Slow completion when using aptitude" (Jan 26, 3:55pm) References: <87oc74dpuy.fsf@ft.bewatermyfriend.org> <87d3njemu9.fsf@ft.bewatermyfriend.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: cheer_xiao , zsh-workers@zsh.org Subject: Re: Slow completion when using aptitude MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 26, 3:55pm, Frank Terbeck wrote: } Subject: Re: Slow completion when using aptitude } } The difference is, that "aptitude install " lists uninstalled } packages, whereas "apt-get install " 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. --