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 <vleschuk@accesssoftek.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Victor Leschuk committed
Dec 15, 2015 at 18:31 UTC
b6b468b2bfaa8015568efad8e0a78b342e1ac640
1 file changed
+1
-1
builtin/grep.c
+1
-1
@@ -832,7 +832,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
832
}
833
834
#ifndef NO_PTHREADS
835
- if (list.nr || cached || online_cpus() == 1)
835
+ if (list.nr || cached)
836
use_threads = 0;
837
#else
838
use_threads = 0;