From: Brice Figureau <brice+zsh@daysofwonder.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] Re: git completion is really slow for some git commands.
Date: Mon, 13 Oct 2008 17:45:06 +0200 [thread overview]
Message-ID: <1223912706.29462.40.camel@localhost.localdomain> (raw)
In-Reply-To: <20081013150120.GA16647@alea.gnuu.de>
On Mon, 2008-10-13 at 17:01 +0200, Jrg Sommer wrote:
> Hello Brice,
>
> Brice Figureau schrieb am Mon 13. Oct, 10:15 (+0200):
> > On Mon, 2008-10-13 at 00:53 +0000, Jrg 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 -- <TAB> takes still very long. But it
optimizes
> > > the case when you specify anything. Try git log --
some/thing<TAB>.
> >
> > [snipped patch]
> >
> > Yes, that works way faster for this case. Unfortunately it doesn't
seem
> > to report the right results:
>
> I've forgot to put the result back in an array. Try this patch:
[snipped patch]
Yes, this fixes the issue, and that's a good enhancement!
Unfortunately if you have plenty of completion possibility under the
same prefix, you hit again the root issue that is that _multi_part is
pretty slow when fed with large arrays. I didn't had a look to
_multi_part in detail yet but I think it is at least an O(n2) kind of
algorithm. I'll try to have a look to the algorithm and see if maybe
there is something that we can do for it.
Thanks for you patch, I'm running with it now :-)
--
Brice Figureau <brice+zsh@daysofwonder.com>
prev parent reply other threads:[~2008-10-13 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 13:01 Brice Figureau
2008-10-13 0:53 ` [PATCH] " Jörg Sommer
2008-10-13 8:15 ` Brice Figureau
2008-10-13 15:01 ` Jörg Sommer
2008-10-13 15:45 ` Brice Figureau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1223912706.29462.40.camel@localhost.localdomain \
--to=brice+zsh@daysofwonder.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).