GNU bug report logs - #60506
feature: parallel grep --recursive

Previous Next

Package: grep;

Reported by: Eike Dierks <foonlyboy <at> gmail.com>

Date: Tue, 3 Jan 2023 00:22:03 UTC

Severity: normal

Full log


View this message in rfc822 format

From: "Paul Jackson" <pj <at> usa.net>
To: 60506 <at> debbugs.gnu.org
Subject: bug#60506: feature: parallel grep --recursive
Date: Mon, 02 Jan 2023 20:34:39 -0600
There's no need for special logic in grep to run parallel grep's.

The "parallel" command can handle that for you.

For example, on the 12 core, 24 thread Ryzen CPU that I am using:

find $HOME -xdev -type f -ctime -333  |  wc -l     ## counts 136126 files.

find $HOME -xdev -type f -ctime -333 |
    parallel -m grep -l foobar | wc -l                        ## takes about 13 seconds

find $HOME -xdev -type f -ctime -333 |
    xargs -d '\n' grep -l foobar | wc -l                      ## takes about 52 seconds

The above parallel invocation ran 24 grep commands in parallel, and took
about 1/4 the time, otherwise performing rather like xargs, which ran one grep
command at a time.

(Granted, reading either the 'parallel' or 'xargs' man pages is not easy <grin>.)

-- 
                Paul Jackson
                pj <at> usa.net




This bug report was last modified 2 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.