]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/blame.c
git diff too slow for a file
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Sun, 2 May 2010 13:04:41 +0000 (15:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 May 2010 14:59:50 +0000 (07:59 -0700)
commit582aa00bdffb27abcf1b27d541b4c231a395d3b8
tree4dc75d74940955a17d0b3c2e4e61e55034dd8ab3
parented215b109fc0e352456ea2ef6a0f8375e28466d5
git diff too slow for a file

Ever since the xdiff library had been introduced to git, all its callers
have used the flag XDF_NEED_MINIMAL.  It makes sure that the smallest
possible diff is produced, but that takes quite some time if there are
lots of differences that can be expressed in multiple ways.

This flag makes a difference for only 0.1% of the non-merge commits in
the git repo of Linux, both in terms of diff size and execution time.
The patches there are mostly nice and small.

SungHyun Nam however reported a case in a different repo where a diff
took more than 20 times longer to generate with XDF_NEED_MINIMAL than
without.  Rebasing became really slow.

This patch removes this flag from all callers.  The default of xdiff is
saner because it has minimal to no impact in the normal case of small
diffs and doesn't incur that much of a speed penalty for large ones.

A follow-up patch may introduce a command line option to set the flag if
the user needs it, similar to GNU diff's -d/--minimal.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-blame.c
builtin-merge-file.c
builtin-merge-tree.c
builtin-rerere.c
combine-diff.c
diff.c
merge-file.c