zsh-workers
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] _git: Also complete FETCH_HEAD, ORIG_HEAD and MERGE_HEAD.
Date: Mon, 29 Mar 2010 09:56:43 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.01.1003230000560.19615@hp.internal> (raw)
In-Reply-To: <dbfc82861003220227i701893e8hee459c1fd72014d1@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2101 bytes --]

[oops, sat in my drafts]

On Mon, 22 Mar 2010, Nikolai Weibull wrote:

> On Mon, Mar 22, 2010 at 03:30, Benjamin R. Haskell <zsh@benizi.com> wrote:
> > Testing the existence of $gitdir/{refname} seems a fine compromise.  
> > (Really, I don't see the issue; this seems like a drop in the bucket 
> > of _git's performance issues...  I s'pose the forks are 
> > prohibitively expensive on Win32?  Revised patch below anyway.)
> 
> > (In case it's unclear, I prefer my previous patch -- doesn't _git 
> > fork all over the place? -- but either one's preferable to no-change 
> > or always-adding-them.)
> 
> Yes, it does, and, as you mention, it’s horribly slow to fork on 
> Windows.  I mean, what where they thinking?  But I question the value 
> of forking for this particular test.  Still, it’s more correct to use 
> rev-parse.  As your patch uses rev-parse to find gitdir once already, 
> we’re not gaining much by globbing instead.
> 
> I just ran a benchmark on Cygwin and it takes about 0.5 seconds to run 
> four rev-parses.
> 
> Perhaps completing them all without checking if they’re valid 
> beforehand is the best solution?

I'd still rather see some checking than none at all.  (MERGE_HEAD isn't 
often applicable, for example.)

In the context I was using to test:

$ git log <Tab>

It appears to be completing both tags and branches, and it already forks 
git once to find each of those (@lines 3117 and 3140).  Four more forks 
(the version calling rev-parse on each name) might be excessive, but one 
doesn't seem so bad (the version calling it once to get --git-dir) for 
the added filtering.

rev-parse each: 100% correct, only much slower on Win32 (~.5s)
rev-parse dir + glob: mostly correct, a-bit-slower on Win32 (~.125s)
always-complete: usually wrong, no slower

Really, I feel like the forking cost would prohibit _git from being 
useful on Win32 in the first place, so it seems an odd metric to use.

(Are there other systems where the fork is expensive?  AFAIK, anything 
Unix-like shouldn't incur too much cost for it, which leaves Win32 and 
...?)

-- 
Best,
Ben

      parent reply	other threads:[~2010-03-29 14:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-21 17:23 Simon Ruderich
2010-03-21 19:48 ` Benjamin R. Haskell
2010-03-21 20:17   ` Nikolai Weibull
2010-03-22  1:25     ` Simon Ruderich
2010-03-22  2:30       ` Benjamin R. Haskell
2010-03-22  9:27         ` Nikolai Weibull
2010-03-29  0:07           ` Simon Ruderich
2010-05-01  8:28             ` Simon Ruderich
2010-05-01 10:46               ` Frank Terbeck
2010-05-01 12:12                 ` Simon Ruderich
2010-05-01 12:17                   ` Frank Terbeck
2010-05-01 20:32                     ` Simon Ruderich
2010-05-02  9:04                       ` Frank Terbeck
2010-05-03 14:51                         ` Benjamin R. Haskell
2010-03-29 13:56           ` Benjamin R. Haskell [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=alpine.LNX.2.01.1003230000560.19615@hp.internal \
    --to=zsh@benizi.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).