git-commit-vandalism/builtin
Nguyễn Thái Ngọc Duy c9486eb04d 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>
2011-11-06 20:31:28 -08:00
..
add.c Merge branch 'ci/commit--interactive-atomic' 2011-05-16 16:47:10 -07:00
annotate.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
apply.c Merge branch 'jm/maint-apply-detects-corrupt-patch-header' 2011-10-19 10:48:29 -07:00
archive.c upload-archive: use start_command instead of fork 2011-10-30 18:45:21 -07:00
bisect--helper.c bisect: introduce support for --no-checkout option. 2011-08-04 15:34:32 -07:00
blame.c Merge branch 'ss/blame-textconv-fake-working-tree' 2011-11-01 15:20:28 -07:00
branch.c branch -m: handle no arg properly 2011-11-02 12:35:37 -07:00
bundle.c
cat-file.c plug a few coverity-spotted leaks 2011-06-20 14:27:36 -07:00
check-attr.c Merge branch 'bc/attr-ignore-case' 2011-10-17 21:37:14 -07:00
check-ref-format.c Change check_refname_format() to reject unnormalized refnames 2011-10-05 13:45:30 -07:00
checkout-index.c checkout-index: remove obsolete comment 2011-08-17 10:39:47 -07:00
checkout.c Merge branch 'jk/argv-array' into maint 2011-10-26 16:13:31 -07:00
clean.c Documentation: clarify "git clean -e <pattern>" 2011-08-28 23:47:55 -07:00
clone.c clone: Quote user supplied path in a single quote pair 2011-10-27 12:02:02 -07:00
commit-tree.c Sync with 1.7.3.2 2010-10-21 17:16:10 -07:00
commit.c Merge branch 'nd/maint-autofix-tag-in-head' 2011-10-13 19:03:19 -07:00
config.c Merge branch 'mm/maint-config-explicit-bool-display' 2011-10-17 21:37:12 -07:00
count-objects.c add description parameter to OPT__VERBOSE 2010-11-15 09:56:51 -08:00
describe.c describe: Refresh the index when run with --dirty 2011-08-11 13:03:35 -07:00
diff-files.c
diff-index.c Submodules: Use "ignore" settings from .gitmodules too for diff and status 2010-08-09 09:11:44 -07:00
diff-tree.c diffcore-rename: fall back to -C when -C -C busts the rename limit 2011-03-22 14:29:07 -07:00
diff.c want_color: automatically fallback to color.ui 2011-08-19 15:51:38 -07:00
fast-export.c
fetch-pack.c Merge branch 'mh/check-ref-format-3' 2011-10-10 15:56:18 -07:00
fetch.c Merge branch 'cn/fetch-prune' 2011-10-26 16:16:29 -07:00
fmt-merge-msg.c
for-each-ref.c for-each-ref: add split message parts to %(contents:*). 2011-09-08 13:56:19 -07:00
fsck.c fsck: avoid reading every object twice 2011-11-06 20:31:28 -08:00
gc.c builtin/gc.c: add missing newline in message 2011-06-19 14:46:39 -07:00
grep.c builtin/grep: simplify lock_and_read_sha1_file() 2011-10-26 13:09:23 -07:00
hash-object.c index_fd(): turn write_object and format_check arguments into one flag 2011-05-09 11:58:19 -07:00
help.c Cast execl*() NULL sentinels to (char *) 2010-07-25 23:14:18 -07:00
index-pack.c Merge branch 'jc/index-pack' 2011-07-19 09:54:51 -07:00
init-db.c read_gitfile_gently(): rename misnamed function to read_gitfile() 2011-08-22 14:04:56 -07:00
log.c
ls-files.c Merge branch 'cb/common-prefix-unification' 2011-10-10 15:56:17 -07:00
ls-remote.c Merge branch 'jc/ls-remote-short-help' 2011-10-05 12:36:26 -07:00
ls-tree.c Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails. 2011-07-25 10:50:11 -07:00
mailinfo.c mailinfo: always clean up rfc822 header folding 2011-05-26 14:13:38 -07:00
mailsplit.c Use parentheses and `...' where appropriate 2010-10-08 12:31:07 -07:00
merge-base.c
merge-file.c Merge branch 'rs/opt-help-text' 2010-11-24 15:55:19 -08:00
merge-index.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-ours.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
merge-recursive.c
merge-tree.c sparse: Fix an "symbol 'merge_file' not decared" warning 2011-04-11 10:35:25 -07:00
merge.c Merge branch 'nd/maint-autofix-tag-in-head' into maint 2011-10-21 10:49:26 -07:00
mktag.c
mktree.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
mv.c builtin/mv.c: plug miniscule memory leak 2011-10-06 13:54:32 -07:00
name-rev.c name-rev: split usage string 2011-10-03 11:55:57 -07:00
notes.c
pack-objects.c Merge branch 'dm/pack-objects-update' 2011-11-01 15:20:07 -07:00
pack-redundant.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
pack-refs.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
patch-id.c patch-id.c: use strbuf instead of a fixed buffer 2011-09-22 09:35:07 -07:00
prune-packed.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
prune.c add description parameter to OPT__DRY_RUN 2010-11-15 09:57:37 -08:00
push.c
read-tree.c Teach read-tree the -n|--dry-run option 2011-05-25 15:04:25 -07:00
receive-pack.c receive-pack: do not expect object 0{40} to exist 2011-11-03 14:27:04 -07:00
reflog.c reflog: actually default to subcommand 'show' 2011-08-01 10:52:34 -07:00
remote-ext.c Remove unused variables 2011-03-22 11:43:27 -07:00
remote-fd.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
remote.c Merge branch 'cn/fetch-prune' 2011-10-26 16:16:29 -07:00
replace.c Change check_ref_format() to take a flags argument 2011-10-05 13:45:29 -07:00
rerere.c rerere: libify rerere_clear() and rerere_gc() 2011-05-08 12:55:34 -07:00
reset.c Merge branch 'jk/reset-reflog-message-fix' 2011-08-08 12:33:33 -07:00
rev-list.c rev-list --verify-object 2011-09-01 15:46:13 -07:00
rev-parse.c rev-parse: add option --resolve-git-dir <path> 2011-08-16 11:04:31 -07:00
revert.c Merge branch 'js/no-cherry-pick-head-after-punted' 2011-10-19 10:49:05 -07:00
rm.c i18n: git-rm basic messages 2011-03-09 23:52:56 -08:00
send-pack.c rename "match_refs()" to "match_push_refs()" 2011-09-12 16:41:53 -07:00
shortlog.c
show-branch.c want_color: automatically fallback to color.ui 2011-08-19 15:51:38 -07:00
show-ref.c Change check_ref_format() to take a flags argument 2011-10-05 13:45:29 -07:00
stripspace.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
symbolic-ref.c Describe various forms of "be quiet" using OPT__QUIET 2010-11-15 10:04:56 -08:00
tag.c Merge branch 'mh/check-ref-format-3' 2011-10-10 15:56:18 -07:00
tar-tree.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00
unpack-file.c
unpack-objects.c zlib: zlib can only process 4GB at a time 2011-06-10 11:52:15 -07:00
update-index.c plug a few coverity-spotted leaks 2011-06-20 14:27:36 -07:00
update-ref.c update-ref: whitespace fix 2011-08-25 14:42:11 -07:00
update-server-info.c add OPT__FORCE 2010-11-15 10:04:43 -08:00
upload-archive.c upload-archive: use start_command instead of fork 2011-10-30 18:45:21 -07:00
var.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
verify-pack.c verify-pack: use index-pack --verify 2011-06-05 22:45:38 -07:00
verify-tag.c Merge branch 'mg/maint-tag-rfc1991' 2010-12-08 11:24:13 -08:00
write-tree.c Move 'builtin-*' into a 'builtin/' subdirectory 2010-02-22 14:29:41 -08:00