Re: Git is not scalable with too many refs/*
- From
Julian Phillips <julian@quantumfyre.co.uk>
- Date
- Sep 29, 2011, 19:10 UTC
- Message-ID
- <67aa39596ee72e1abbecf488a2916923@quantumfyre.co.uk>
- In-Reply-To
- <4E84B89F.4060304@lsrfire.ath.cx>
On Thu, 29 Sep 2011 20:27:43 +0200, René Scharfe wrote:
Show 23 quoted lines
> Am 29.09.2011 04:19, schrieb Julian Phillips:
>> Does the following help?
>>
>> diff --git a/builtin/checkout.c b/builtin/checkout.c
>> index 5e356a6..f0f4ca1 100644
>> --- a/builtin/checkout.c
>> +++ b/builtin/checkout.c
>> @@ -605,7 +605,7 @@ static int add_one_ref_to_rev_list_arg(const
>> char
>> *refname,
>> int flags,
>> void *cb_data)
>> {
>> - add_one_rev_list_arg(cb_data, refname);
>> + add_one_rev_list_arg(cb_data, strdup(sha1_to_hex(sha1)));
>> return 0;
>> }
>
> Hmm. Can we get rid of the multiple ref lookups fixed by the above
> *and* the overhead of dealing with a textual argument list at the
> same
> time by calling add_pending_object directly, like this? (Factoring
> out add_pending_sha1 should be a separate patch..)Seems like a good idea. I get the same sort of times as with my patch, but it makes the code _feel_ much nicer (and slightly smaller). Mine was definitely more of a "it's 2am, but I think the problem is here" type of patch ;)
-- Julian