Skip to content

Commit

Permalink
grep: allow threading even on a single-core machine
Browse files Browse the repository at this point in the history
Earlier we disabled threading when online_cpus() said "1", but on a
filesystem with long latency (or in a cold cache situation), using
multiple threads to drive I/O in parallel would improve performance
even on a single-core machines.

Signed-off-by: Victor Leschuk <vleschuk@accesssoftek.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Victor Leschuk authored and Junio C Hamano committed Dec 15, 2015
1 parent 37023ba commit b6b468b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}

#ifndef NO_PTHREADS
if (list.nr || cached || online_cpus() == 1)
if (list.nr || cached)
use_threads = 0;
#else
use_threads = 0;
Expand Down

0 comments on commit b6b468b

Please sign in to comment.