All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>, git <git@vger.kernel.org>
Subject: Re: grep vs git grep performance?
Date: Thu, 26 Oct 2017 18:13:54 +0200	[thread overview]
Message-ID: <20171026161354.23037-1-szeder.dev@gmail.com> (raw)
In-Reply-To: <1509030170.10651.59.camel@perches.com>

> Comparing a cache warm git grep vs command line grep
> shows significant differences in cpu & wall clock.
> 
> Any ideas how to improve this?
> 
> $ time git grep "\bseq_.*%p\W" | wc -l
> 112
> 
> real	0m4.271s
> user	0m15.520s
> sys	0m0.395s
> 
> $ time grep -r --include=*.[ch] "\bseq_.*%p\W" * | wc -l
> 112
> 
> real	0m1.164s
> user	0m0.847s
> sys	0m0.314s

Note that this "regular" grep is limited to *.c and *.h files, while
the above git grep invocation isn't and has to look at all tracked
files.  How does

  git grep "\bseq_.*%p\W" "*.[ch]"

fare?


  parent reply	other threads:[~2017-10-26 16:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 15:02 grep vs git grep performance? Joe Perches
2017-10-26 15:11 ` Han-Wen Nienhuys
2017-10-26 15:55   ` Joe Perches
2017-10-26 16:13 ` SZEDER Gábor [this message]
2017-10-26 16:20   ` Joe Perches
2017-10-26 16:58 ` Stefan Beller
2017-10-26 17:41   ` Joe Perches
2017-10-26 17:45     ` Stefan Beller
2017-10-27 17:22       ` Joe Perches
2017-10-27 22:11         ` Ævar Arnfjörð Bjarmason
2017-10-27 23:22           ` Joe Perches
2017-10-28  7:45             ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171026161354.23037-1-szeder.dev@gmail.com \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=joe@perches.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.