From: Eli Zaretskii <eliz@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org, lennart.borgman@gmail.com, miles@gnu.org
Subject: Re: Why does not rgrep use "grep -r"?
Date: Sat, 03 Nov 2007 13:01:55 +0200 [thread overview]
Message-ID: <uy7dfr3rw.fsf@gnu.org> (raw)
In-Reply-To: <85bqabslzs.fsf@lola.goethe.zz> (message from David Kastrup on Sat, 03 Nov 2007 10:43:03 +0100)
> From: David Kastrup <dak@gnu.org>
> Cc: Miles Bader <miles@gnu.org>, schwab@suse.de, lennart.borgman@gmail.com, emacs-devel@gnu.org
> Date: Sat, 03 Nov 2007 10:43:03 +0100
>
> Totally warm cache:
>
> dak@lola:/usr/local/texlive/2007$ time find -name \*.tex|xargs grep snort
> ./texmf-dist/source/latex/ae/aesample.tex:and whooping and sneezing and snorting, that I could not hear myself think for
>
> real 0m0.974s
> user 0m0.372s
> sys 0m0.536s
> dak@lola:/usr/local/texlive/2007$ time grep -r --include=\*.tex snort .
> ./texmf-dist/source/latex/ae/aesample.tex:and whooping and sneezing and snorting, that I could not hear myself think for
>
> real 0m1.225s
> user 0m0.376s
> sys 0m0.764s
> [...]
> On a warm cache, it is pretty much the same.
Perhaps for the Linux filesystem, it is. It looks as it's quite
different on Windows:
With warm cache:
timep grep -r snort d:/gnu/gdb-CVS/src/gdb > nul
real 00h00m03.171s
user 00h00m00.234s
sys 00h00m02.312s
timep find d:/gnu/gdb-CVS/src/gdb -name "*.c" | xargs grep snort > nul
real 00h00m03.921s
user 00h00m00.015s
sys 00h00m00.015s
That's a 20% difference in elapsed time (the fact that user and sys
are zero is just an artefact of the timep command implementation on
Windows).
With cold cache:
timep grep -r snort d:/gnu/gdb-CVS/src/gdb > nul
real 00h00m15.531s
user 00h00m00.328s
sys 00h00m03.140s
timep find d:/gnu/gdb-CVS/src/gdb -name "*.c" | xargs grep snort > nul
real 00h00m13.687s
user 00h00m00.015s
sys 00h00m00.078s
That's 11%, a much smaller gain, and in the other direction.
next prev parent reply other threads:[~2007-11-03 11:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 21:42 Why does not rgrep use "grep -r"? Lennart Borgman (gmail)
2007-11-02 22:44 ` Miles Bader
2007-11-02 23:29 ` Andreas Schwab
2007-11-02 23:56 ` Lennart Borgman (gmail)
2007-11-03 1:31 ` Miles Bader
2007-11-03 1:45 ` Lennart Borgman (gmail)
2007-11-03 3:37 ` Miles Bader
2007-11-03 8:40 ` Eli Zaretskii
2007-11-03 9:43 ` David Kastrup
2007-11-03 11:01 ` Eli Zaretskii [this message]
2007-11-03 11:54 ` Lennart Borgman (gmail)
2007-11-04 18:59 ` David Kastrup
2007-11-05 5:24 ` Eli Zaretskii
2007-11-03 4:01 ` Ken Raeburn
2007-11-03 8:41 ` Eli Zaretskii
2007-11-03 8:37 ` Eli Zaretskii
2007-11-03 14:01 ` Stefan Monnier
2007-11-04 0:57 ` Kim F. Storm
2007-11-04 1:03 ` Lennart Borgman (gmail)
2007-11-04 1:15 ` Miles Bader
2007-11-04 10:32 ` Jason Rumney
2007-11-04 11:32 ` Lennart Borgman (gmail)
2007-11-04 11:48 ` Jason Rumney
2007-11-04 12:01 ` Lennart Borgman (gmail)
2007-11-05 5:22 ` Eli Zaretskii
2007-12-12 1:56 ` Lennart Borgman (gmail)
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=uy7dfr3rw.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
--cc=miles@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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.