git-commit-vandalism/builtin
Thomas Rast 53b8d931b6 grep: disable threading in non-worktree case
Measurements by various people have shown that grepping in parallel is
not beneficial when the object store is involved.  For example, with a
simple regex:

  Threads     | --cached case            | worktree case
  ----------------------------------------------------------------
  8 (default) | 2.88u 0.21s 0:02.94real  | 0.19u 0.32s 0:00.16real
  4           | 2.89u 0.29s 0:02.99real  | 0.16u 0.34s 0:00.17real
  2           | 2.83u 0.36s 0:02.87real  | 0.18u 0.32s 0:00.26real
  NO_PTHREADS | 2.16u 0.08s 0:02.25real  | 0.12u 0.17s 0:00.31real

This happens because all the threads contend on read_sha1_mutex almost
all of the time.  A more complex regex allows the threads to do more
work in parallel, but as Jeff King found out, the "super boost" (much
higher clock when only one core is active) feature of recent CPUs
still causes the unthreaded case to win by a large margin.

So until the pack machinery allows unthreaded access, we disable
grep's threading in all but the worktree case.

Helped-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-16 15:47:25 -08:00
..
add.c
annotate.c
apply.c Merge branch 'ab/clang-lints' 2011-12-05 15:12:34 -08:00
archive.c
bisect--helper.c
blame.c
branch.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
bundle.c
cat-file.c
check-attr.c
check-ref-format.c
checkout-index.c
checkout.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
clean.c
clone.c
commit-tree.c
commit.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
config.c
count-objects.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c
fast-export.c
fetch-pack.c
fetch.c Merge branch 'jc/pull-signed-tag' 2011-12-09 13:37:09 -08:00
fmt-merge-msg.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
for-each-ref.c
fsck.c
gc.c
grep.c grep: disable threading in non-worktree case 2011-12-16 15:47:25 -08:00
hash-object.c
help.c
index-pack.c
init-db.c
log.c
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
mktag.c
mktree.c
mv.c
name-rev.c
notes.c Copy resolve_ref() return value for longer use 2011-12-05 16:21:06 -08:00
pack-objects.c Merge branch 'jc/maint-pack-object-cycle' 2011-12-05 15:19:34 -08:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
push.c
read-tree.c
receive-pack.c Copy resolve_ref() return value for longer use 2011-12-05 16:21:06 -08:00
reflog.c
remote-ext.c
remote-fd.c
remote.c
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c
revert.c revert --abort: do not leave behind useless sequencer-old directory 2011-11-23 10:56:29 -08:00
rm.c
send-pack.c
shortlog.c
show-branch.c
show-ref.c
stripspace.c stripspace: fix outdated comment 2011-12-05 15:04:38 -08:00
symbolic-ref.c
tag.c Merge branch 'nd/resolve-ref' 2011-12-09 13:37:14 -08:00
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
var.c
verify-pack.c
verify-tag.c
write-tree.c