tree-diff: reuse base str(buf) memory on sub-tree recursion
authorKirill Smelkov <kirr@mns.spb.ru>
Thu, 27 Mar 2014 14:22:07 +0000 (18:22 +0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Mar 2014 18:52:35 +0000 (11:52 -0700)
Instead of allocating it all the time for every subtree in
ll_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>
No differences found