From: Kirill Smelkov Date: Thu, 27 Mar 2014 14:22:07 +0000 (+0400) Subject: tree-diff: reuse base str(buf) memory on sub-tree recursion X-Git-Tag: v2.1.0-rc0~201^2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/12cd81743dc4645ef909b0c38582f5714c9a8ff7?hp=12cd81743dc4645ef909b0c38582f5714c9a8ff7 tree-diff: reuse base str(buf) memory on sub-tree recursion 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 Signed-off-by: Junio C Hamano ---