From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Running process with grep-find interface is very slow Date: Mon, 26 Sep 2011 21:48:08 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1317095269 17879 80.91.229.12 (27 Sep 2011 03:47:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Sep 2011 03:47:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 27 05:47:44 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R8Ody-0005Hh-Dl for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Sep 2011 05:47:42 +0200 Original-Received: from localhost ([::1]:55155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Ody-0005aW-2G for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Sep 2011 23:47:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Odu-0005a3-4J for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 23:47:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8Odt-0007Qk-5X for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 23:47:38 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Odt-0007Qb-0B for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 23:47:37 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R8Odr-0005Gu-Va for help-gnu-emacs@gnu.org; Tue, 27 Sep 2011 05:47:35 +0200 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Sep 2011 05:47:35 +0200 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Sep 2011 05:47:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.20) Gecko/20110804 Thunderbird/3.1.12 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82349 Archived-At: On 8/31/11 2:18 AM, Tom wrote: > Tom gmail.com> 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