diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-11-07 09:59:25 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-11-06 20:31:28 -0800 |
commit | c9486eb04dd99fc00df3e68f9b908f9ad7ff9728 (patch) | |
tree | 1604f80dc18373e70f69c3b0578c74846a0d623d /t/t5100 | |
parent | verify_packfile(): check as many object as possible in a pack (diff) | |
download | tgif-c9486eb04dd99fc00df3e68f9b908f9ad7ff9728.tar.xz |
fsck: avoid reading every object twice
During verify_pack() all objects are read for SHA-1 check. Then
fsck_sha1() is called on every object, which read the object again
(fsck_sha1 -> parse_object -> read_sha1_file).
Avoid reading an object twice, do fsck_sha1 while we have an object
uncompressed data in verify_pack.
On git.git, with this patch I got:
$ /usr/bin/time ./git fsck >/dev/null
98.97user 0.90system 1:40.01elapsed 99%CPU (0avgtext+0avgdata 616624maxresident)k
0inputs+0outputs (0major+194186minor)pagefaults 0swaps
Without it:
$ /usr/bin/time ./git fsck >/dev/null
231.23user 2.35system 3:53.82elapsed 99%CPU (0avgtext+0avgdata 636688maxresident)k
0inputs+0outputs (0major+461629minor)pagefaults 0swaps
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5100')
0 files changed, 0 insertions, 0 deletions