[Top][All Lists]

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

Re: Running process with grep-find interface is very slow

From: Kevin Rodgers
Subject: Re: Running process with grep-find interface is very slow
Date: Mon, 26 Sep 2011 21:48:08 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv: Gecko/20110804 Thunderbird/3.1.12

On 8/31/11 2:18 AM, Tom wrote:
Tom<adatgyujto<at>>  writes:

Why is it so much slower to run the same command via grep than
via the command line?

Turns out it was the way I ran the command.

I created a small convenience function which always started the
search from the root directory of the project

(let ((default-directory rootdir))
   (grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))

Looks like default-directory caused the problem, because if I change it
to this:

   (with-current-buffer (find-file-noselect rootdir)
     (grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))

then it's not slow anymore.

It fixed the problem, though I don't really get the difference. Isn't
setting default-directory temporarily a usual way to make a directory
current for the duration of a function?

Yes.  Could you profile the grep-*, compile-*, and compilation-*
functions with elp.el under both scenarios to show where the performance
problem occurs?

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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