Re: [PATCH 0/3] Un-pessimize "diff-index $commit -- $pathspec"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2011, 22:05 UTC
- Message-ID
- <7v1uw36fgb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CA+55aFzk+hn9wMAp3H92SHAGO8CQVBpTsmR41FgCy32T7muUzA@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 14 quoted lines
> On Mon, Aug 29, 2011 at 2:33 PM, Junio C Hamano <gitster@pobox.com> wrote: >> >> Before and after applying this series, looking for changes in the kernel >> repository with a fairly narrow pathspec gets a moderate speeds up. > > "moderate speeds up"? > > Looks like a big win to me. Admittedly it's already a pretty fast > operation, but script it and repeat it a million times, and that will > matter a lot more. > > I guess the "--raw" diff part means that you are hiding the time to > make a real diff, which would otherwise swamp everything else. Even > so, this looks like a good improvement.
The topic started by Marat Radchenko in
http://thread.gmane.org/gmane.comp.version-control.git/179926
who was trying to pick a single path (we do not know how deep it is), and was comparing between these two:
$ time git show branch:file | diff -u - file > /dev/null real 0m0.003s user 0m0.000s sys 0m0.000s $ time git diff branch -- file > /dev/null real 0m31.442s user 0m31.040s sys 0m0.380s
Replacing "diff -u" with "git diff --no-index" in the former didn't make much of a difference. It turned out that Marat had 603k paths in the index and the most of the time was spent in the unpack machinery.