Subject: Re: Why is --pretty=format: so slow?

From: René Scharfe <[email-masked]>
Date: Sun, 04 Nov 2007 11:31:10 +0100

Junio C Hamano schrieb:
> Paul Mackerras <[email-masked]> writes:
> 
>> Strace seems to indicate that git log is doing at least one sequence
>> of open, fstat64, fcntl64, getdents64 and close for each line of
>> output in the --pretty=format: cases, but not in the other cases.
> 
> I bet that is coming from doing find_unique_abbrev() to fill
> fields %h, %t and %p, even when the output format does not ask
> for any of them.
> 
> Dscho, can we stop calling find_unique_abbrev() unconditionally
> before being asked?

Incidentally, I'm finishing a patch series to add git-describe style
placeholders.  It needs such an optimization even more badly (and has
it).  Speeding up other slow placeholder expansions falls out quite
naturally.  Please wait just a few minutes..

René