Re: Performance issue of 'git branch'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2009, 04:40 UTC
- Message-ID
- <7vtz146mgr.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.01.0907221921570.3352@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 10 quoted lines
> On Wed, 22 Jul 2009, Linus Torvalds wrote: >> >> Ooh yes. That would do it. It's going to peel and look up every single ref >> it finds, so it's going to look up _hundreds_ of objects (all the tags, >> all the commits they point to, etc etc). Even if it then only shows a >> couple of branches. >> >> Junio, any ideas? > > I had one of my own.
It seems that I missed all the fun while going out to dinner.
> It uses the "raw" version of 'for_each_ref()' (which doesn't verify that > the ref is valid), and then does the "type verification" before it starts > doing any gentle commit lookup.
Hmm, we now have to remember what this patch did, if we ever wanted to introduce negative refs later (see ef06b91 do_for_each_ref: perform the same sanity check for leftovers., 2006-11-18). Not exactly nice to spread the codepaths that need to be updated. Is the cold cache performance of "git branch" to list your local branches that important?