Re: What's the difference between `git show branch:file | diff -u - file` vs `git diff branch file`?
Junio C Hamano <gitster@pobox.com> writes:
Show 22 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Of course the merge machinery does not know anything about pruning with
>> pathspec, so it is understandable (not justifiable) it would walk the full
>> tree.
>>
>> Will try to find time this week to cook up something.
>
> This is still rough, but seems to pass the test suite, and gives me some
> performance boost when applied to the kernel tree:
>
> (without patch)
> $ time git diff --raw --cached v2.6.30 -- virt/kvm
> real 0m0.114s
> user 0m0.088s
> sys 0m0.028s
>
> (with patch)
> $ time ./git diff --raw --cached v2.6.30 -- virt/kvm
> real 0m0.075s
> user 0m0.068s
> sys 0m0.008s
Heh, this is even better without --cached.
(without patch)
$ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6
real 0m0.538s
user 0m0.492s
sys 0m0.048s (with patch)
$ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6
real 0m0.038s
user 0m0.028s
sys 0m0.012s