emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does not rgrep use "grep -r"?


From: Eli Zaretskii
Subject: Re: Why does not rgrep use "grep -r"?
Date: Sat, 03 Nov 2007 13:01:55 +0200

> From: David Kastrup <address@hidden>
> Cc: Miles Bader <address@hidden>,  address@hidden,  address@hidden,  
> address@hidden
> Date: Sat, 03 Nov 2007 10:43:03 +0100
> 
> Totally warm cache:
> 
> address@hidden:/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
> address@hidden:/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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]