]> git.ipfire.org Git - thirdparty/git.git/commit - diffcore-rename.c
[PATCH] Optimize diff-tree -[CM] --stdin
authorJunio C Hamano <junkio@cox.net>
Fri, 27 May 2005 22:56:38 +0000 (15:56 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 29 May 2005 18:17:44 +0000 (11:17 -0700)
commitf0c6b2a2fd98b51f1f2655ea69ace9763da28e79
tree29668f3fbfb0e4871ac17f72b144eb289be5e490
parent6145ee8b361959db04b8cdefc883e4fc2dc27276
[PATCH] Optimize diff-tree -[CM] --stdin

This attempts to optimize "diff-tree -[CM] --stdin", which
compares successible tree pairs.  This optimization does not
make much sense for other commands in the diff-* brothers.

When reading from --stdin and using rename/copy detection, the
patch makes diff-tree to read the current index file first.
This is done to reuse the optimization used by diff-cache in the
non-cached case.  Similarity estimator can avoid expanding a
blob if the index says what is in the work tree has an exact
copy of that blob already expanded.

Another optimization the patch makes is to check only file sizes
first to terminate similarity estimation early.  In order for
this to work, it needs a way to tell the size of the blob
without expanding it.  Since an obvious way of doing it, which
is to keep all the blobs previously used in the memory, is too
costly, it does so by keeping the filesize for each object it
has already seen in memory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff-tree.c
diff.c
diff.h
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h