zsh-workers
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Brett Simmers <swtaarrs@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Git completion slowness
Date: Thu, 9 Dec 2010 17:18:26 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1012091710280.2792@hp> (raw)
In-Reply-To: <AANLkTi=4OkTExqGZOCY8B64HGatuKh9S=8hkfKkMrF3K@mail.gmail.com>

On Thu, 9 Dec 2010, Brett Simmers wrote:

> I asked about this in IRC and got a request to send some details to 
> the mailing list, so here they are -
>
> Whenever I try to use tab completion with a git command, zsh hangs for 
> a few minutes using full cpu before coming back with an answer.  It 
> usually isn't causing much disk activity, just cpu.  The command I try 
> to use most often is "git checkout foo<tab>", where foo is the first 
> few letters of a branch name, but the slowness seems to also happen 
> anywhere else I need to complete a filename or branch/tag name.
>
> Some details of my repository:
> - 96,000 files
> - .git is 17GB
> - Deepest directory nesting in the repository is 15 levels but most 
> files are no deeper than 7 levels
>
> I'm running zsh 4.3.10 with _git from today's CVS.  Host OS is Ubuntu 
> 10.04.1, 6GB of RAM with an Intel Core2Quad 2.4ghz.  My git repo is on 
> an SSD (OSZ Vertex I think), so none of the hardware should be a 
> bottleneck.  Bash-completion on the same setup in the same repo works 
> fine without any delays.

I'm still using the workaround of pre-defining this function in a 
startup script:

function __git_files () {}

That prevents all git file completion, which is the cause of the 
slowness (specifically, _multi_parts completion for filenames).  Recall 
that paths are valid arguments to a `git checkout`.

It does mean that git completion won't ever offer up filenames, which I 
can live with, because:

1) I have <C-x><C-f> bound to filename completion (so I can ^X^F 
complete, if I really don't want to type the name, and it exists on 
disk)

and

2) It prevents pegging a CPU at 100% for minutes.

Prior messages:

See: http://www.zsh.org/mla/users/2010/msg00434.html
and my response at: http://www.zsh.org/mla/users/2010/msg00435.html
original diagnosis of _multi_parts being the cause: http://www.zsh.org/mla/workers/2008/msg01535.html

-- 
Best,
Ben


  reply	other threads:[~2010-12-09 22:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 22:06 Brett Simmers
2010-12-09 22:18 ` Benjamin R. Haskell [this message]
2010-12-10  0:10   ` Brett Simmers
     [not found]   ` <87k4jhsx78.fsf@ft.bewatermyfriend.org>
2010-12-10 11:37     ` Nikolai Weibull
2010-12-10 11:49       ` Frank Terbeck
2010-12-10 12:09         ` Nikolai Weibull
2010-12-10 11:54       ` Thomas Gstädtner
2010-12-10 12:11         ` Nikolai Weibull
2010-12-10 12:48   ` Oliver Kiddle
2010-12-10 14:00     ` Nikolai Weibull
2010-12-10 11:29 ` Nikolai Weibull

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=alpine.LNX.2.01.1012091710280.2792@hp \
    --to=zsh@benizi.com \
    --cc=swtaarrs@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).