diff options
author | Junio C Hamano <junkio@cox.net> | 2005-05-27 15:56:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-29 11:17:44 -0700 |
commit | f0c6b2a2fd98b51f1f2655ea69ace9763da28e79 (patch) | |
tree | 29668f3fbfb0e4871ac17f72b144eb289be5e490 /diff.h | |
parent | 6145ee8b361959db04b8cdefc883e4fc2dc27276 (diff) | |
download | git-f0c6b2a2fd98b51f1f2655ea69ace9763da28e79.tar.gz |
[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>
Diffstat (limited to 'diff.h')
-rw-r--r-- | diff.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -29,6 +29,8 @@ extern void diff_unmerge(const char *path); extern int diff_scoreopt_parse(const char *opt); #define DIFF_SETUP_REVERSE 1 +#define DIFF_SETUP_USE_CACHE 2 +#define DIFF_SETUP_USE_SIZE_CACHE 4 extern void diff_setup(int flags); #define DIFF_DETECT_RENAME 1 |