From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11730 invoked by alias); 9 Dec 2010 22:27:39 -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: 28512 Received: (qmail 6986 invoked from network); 9 Dec 2010 22:27:28 -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 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Thu, 9 Dec 2010 17:18:26 -0500 (EST) From: "Benjamin R. Haskell" To: Brett Simmers cc: zsh-workers@zsh.org Subject: Re: Git completion slowness In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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", 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 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