author | Junio C Hamano <junkio@cox.net> | |
Wed, 4 May 2005 08:45:24 +0000 (01:45 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 4 May 2005 08:45:24 +0000 (01:45 -0700) | ||
commit | b46f0b6dfd09629645efc59cda76e7e4fad7ca39 | |
tree | 74a490c6a742801a5318f8c5a8be153a99d74e4b | tree | snapshot |
parent | 6fa28064b0c9da9c2c8696b4eac28ee5beaee469 | commit | diff |
Optimize diff-cache -p --cached
This patch optimizes "diff-cache -p --cached" by avoiding to
inflate blobs into temporary files when the blob recorded in the
cache matches the corresponding file in the work tree. The file
in the work tree is passed as the comparison source in such a
case instead.
This optimization kicks in only when we have already read the
cache this optimization and this is deliberate. Especially,
diff-tree does not use this code, because changes are contained
in small number of files relative to the project size most of
the time, and reading cache is so expensive for a large project
that the cost of reading it outweighs the savings by not
inflating blobs.
Also this patch cleans up the structure passed from diff clients
by removing one unused structure member.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch optimizes "diff-cache -p --cached" by avoiding to
inflate blobs into temporary files when the blob recorded in the
cache matches the corresponding file in the work tree. The file
in the work tree is passed as the comparison source in such a
case instead.
This optimization kicks in only when we have already read the
cache this optimization and this is deliberate. Especially,
diff-tree does not use this code, because changes are contained
in small number of files relative to the project size most of
the time, and reading cache is so expensive for a large project
that the cost of reading it outweighs the savings by not
inflating blobs.
Also this patch cleans up the structure passed from diff clients
by removing one unused structure member.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-tree-helper.c | diff | blob | history | |
diff.c | diff | blob | history | |
diff.h | diff | blob | history |