From: Victor Leschuk Date: Tue, 15 Dec 2015 15:31:39 +0000 (+0300) Subject: grep: allow threading even on a single-core machine X-Git-Tag: v2.8.0-rc0~125^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b6b468b2bfaa8015568efad8e0a78b342e1ac640 grep: allow threading even on a single-core machine 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin/grep.c b/builtin/grep.c index d04f4400d9..734d6ceaae 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -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;