Skip to content

Commit b6b468b

Browse files
vleschukgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37023ba commit b6b468b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
832832
}
833833

834834
#ifndef NO_PTHREADS
835-
if (list.nr || cached || online_cpus() == 1)
835+
if (list.nr || cached)
836836
use_threads = 0;
837837
#else
838838
use_threads = 0;

0 commit comments

Comments
 (0)