Re: grep vs git grep performance?
- From
Joe Perches <joe@perches.com>
- Date
- Oct 26, 2017, 15:55 UTC
- Message-ID
- <1509033321.11245.3.camel@perches.com>
- In-Reply-To
- <CAFQ2z_P9bpw+Pc2DhJTCB8dxj-5JAKLE=nyvToGuiRA8wV66Wg@mail.gmail.com>
On Thu, 2017-10-26 at 17:11 +0200, Han-Wen Nienhuys wrote:
Show 7 quoted lines
> On Thu, Oct 26, 2017 at 5:02 PM, Joe Perches <joe@perches.com> wrote: > > Comparing a cache warm git grep vs command line grep > > shows significant differences in cpu & wall clock. > > > > Any ideas how to improve this? > > Is git-grep multithreaded?
Yes, at least according to the documentation
$ git grep --help
[]
grep.threads
Number of grep worker threads to use. If unset (or set to 0), 8
threads are used by default (for now).> IIRC, grep -r uses multiple threads. (Do > you have a 4-core machine?)
I have a 2 core machine with hyperthreading
$ cat /proc/cpuinfo [] model name : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz stepping : 3 microcode : 0xba cpu MHz : 2400.000 cache size : 3072 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2