From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22412 invoked from network); 13 Oct 2008 08:16:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Oct 2008 08:16:56 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 72468 invoked from network); 13 Oct 2008 08:16:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Oct 2008 08:16:31 -0000 Received: (qmail 12103 invoked by alias); 13 Oct 2008 08:16:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25872 Received: (qmail 12071 invoked from network); 13 Oct 2008 08:16:05 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 13 Oct 2008 08:16:05 -0000 Received: from mail.daysofwonder.com (mail.daysofwonder.com [87.98.213.69]) by bifrost.dotsrc.org (Postfix) with ESMTP id 8DBE880524C0 for ; Mon, 13 Oct 2008 10:16:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.daysofwonder.com (Postfix) with ESMTP id 789A868088; Mon, 13 Oct 2008 10:16:01 +0200 (CEST) X-Virus-Scanned: by amavisd-new at daysofwonder.com Received: from mail.daysofwonder.com ([127.0.0.1]) by localhost (mail.daysofwonder.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X6AXAPTCQAHV; Mon, 13 Oct 2008 10:15:53 +0200 (CEST) Received: from sc.dow-test.wanadoo.fr (dow.net8.nerim.net [213.41.185.138]) (Authenticated sender: brice) by mail.daysofwonder.com (Postfix) with ESMTPA id 85F1368086; Mon, 13 Oct 2008 10:15:53 +0200 (CEST) Subject: Re: [PATCH] Re: git completion is really slow for some git commands. From: Brice Figureau To: =?ISO-8859-1?Q?J=F6rg?= Sommer Cc: zsh-workers@sunsite.dk In-Reply-To: References: <1223557300.563.31.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-15 Date: Mon, 13 Oct 2008 10:15:53 +0200 Message-Id: <1223885753.29462.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.92.1/8417/Mon Oct 13 09:34:29 2008 on bifrost X-Virus-Status: Clean Hi Jörg, On Mon, 2008-10-13 at 00:53 +0000, Jörg Sommer wrote: > > * this shell array is then passed to _multi_parts for path splitting of > > each element. This is this operation that takes age. As soon as I change > > the _multi_parts code to just call a naive compadd and return, the > > completion is (almost) immediate, and seems to work fine. > > Can you try this patch? It doesn't change anything if you didn't specify > anything, i.e. git log -- takes still very long. But it optimizes > the case when you specify anything. Try git log -- some/thing. [snipped patch] Yes, that works way faster for this case. Unfortunately it doesn't seem to report the right results: when I try: git log c it show in the completion menu: ---- index file cleopatragame.com ---- branch cdn While I do have a cdn branch, I also happen to have more than one file/directory starting with a 'c' in the index (there is common, and colosseumgame.com). It's exactly as it was giving only the first choice. I looked to your patch, and tried it outside of the completion system and it was working fine (ie returning only results starting with 'c'), so I'm puzzled. At least it is a magnitude more faster :-) You are definitely on the right track. Many thanks, -- Brice Figureau