summaryrefslogtreecommitdiff
path: root/convert-objects.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2007-08-10 09:51:58 -0700
committerJunio C Hamano <gitster@pobox.com>2007-08-10 13:57:43 -0700
commit22631473e0b7a33356587ba3e38a9b4cc4dba2f1 (patch)
treef0dfa89ae59bc56039c72eebcc8013d0169bd399 /convert-objects.c
parentaf3785dc5a76f4d5ddb8039e33c322e0e8b60e72 (diff)
downloadgit-22631473e0b7a33356587ba3e38a9b4cc4dba2f1.tar.gz
Fix "git commit directory/" performance anomaly
This trivial patch avoids re-hashing files that are already clean in the index. This mirrors what commit 0781b8a9b2fe760fc4ed519a3a26e4b9bd6ccffe did for "git add .", only for "git commit ." instead. This improves the cold-cache case immensely, since we don't need to bring in all the file contents, just the index and any files dirty in the index. Before: [torvalds@woody linux]$ time git commit . real 1m49.537s user 0m3.892s sys 0m2.432s After: [torvalds@woody linux]$ time git commit . real 0m14.273s user 0m1.312s sys 0m0.516s (both after doing a "echo 3 > /proc/sys/vm/drop_caches" to get cold-cache behaviour - even with the index optimization git still has to "lstat()" all the files, so with a truly cold cache, bringing all the inodes in will take some time). [jc: trivial "return 0;" fixed] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert-objects.c')
0 files changed, 0 insertions, 0 deletions