summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorKirill Smelkov <kirr@mns.spb.ru>2014-02-07 21:48:52 +0400
committerJunio C Hamano <gitster@pobox.com>2014-02-24 14:46:12 -0800
commitf89441fe15a939278a982b0dfe57adb2927fe1c4 (patch)
treeea90054a23b4d00416a230ed2f86b1172cea06c7 /diff.h
parent26faeba99b0d2b6fbc6d7109ea7ce2656d65248f (diff)
downloadgit-ks/tree-diff-more.tar.gz
tree-diff: reuse base str(buf) memory on sub-tree recursionks/tree-diff-more
instead of allocating it all the time for every subtree in __diff_tree_sha1, let's allocate it once in diff_tree_sha1, and then all callee just use it in stacking style, without memory allocations. This should be faster, and for me this change gives the following slight speedups for git log --raw --no-abbrev --no-renames --format='%H' navy.git linux.git v3.10..v3.11 before 0.618s 1.903s after 0.611s 1.889s speedup 1.1% 0.7% Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.h b/diff.h
index aba32189dc..bf834ff8c8 100644
--- a/diff.h
+++ b/diff.h
@@ -190,7 +190,7 @@ const char *diff_line_prefix(struct diff_options *);
extern const char mime_boundary_leader[];
extern int __diff_tree_sha1(const unsigned char *old, const unsigned char *new,
- const char *base, struct diff_options *opt);
+ struct strbuf *base, struct diff_options *opt);
extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
const char *base, struct diff_options *opt);
extern int diff_root_tree_sha1(const unsigned char *new, const char *base,