Subject: Re: Git is not scalable with too many refs/*

From: René Scharfe <[email-masked]>
Date: Sat, 01 Oct 2011 17:28:47 +0200

Am 30.09.2011 20:17, schrieb René Scharfe:
> Am 30.09.2011 18:52, schrieb Junio C Hamano:
>> It might be a better solution to not bother to clear the marks at
>> all; would it break anything in this codepath?
> 
> Unfortunately, yes; the cleanup part was added by 5c08dc48 later,
> when it become apparent that it's really needed.
> 
> However, since the patch only buys us a 5% speedup I'm not sure it's 
> worth it in its current form.

I found something better: A trick used by bisect and bundle.  They copy
the list of pending objects from rev_info before calling
prepare_revision_walk and then go through it to clean up the commit
marks without going through the refs again.  And I think we can even
improve it a little.

The following patches tighten some orphan/detached head tests a little,
then comes a resend of my first patch on this topic, only split up into
two, then four patches that introduce the trick mentioned above (which
could be squashed together perhaps) and the last one is a bonus
refactoring patch.

 bisect.c                   |   20 +++++++-------
 builtin/checkout.c         |   58 +++++++++++++------------------------------
 bundle.c                   |   11 +++-----
 commit.c                   |   14 ++++++++++
 commit.h                   |    1 +
 revision.c                 |   14 +++++++---
 revision.h                 |    2 +
 t/t2020-checkout-detach.sh |    7 ++++-
 8 files changed, 64 insertions(+), 63 deletions(-)

René