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: Finding files with tags Date: Thu, 16 Mar 2006 09:57:28 -0700 Message-ID: References: <3350075.post@talk.nabble.com> <3385374.post@talk.nabble.com> <3390232.post@talk.nabble.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1142528418 7617 80.91.229.2 (16 Mar 2006 17:00:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Mar 2006 17:00:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 16 18:00:18 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FJvpC-0008Ec-HZ for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Mar 2006 17:59:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FJvpB-0006Kh-CD for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Mar 2006 11:59:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FJvox-0006IV-NP for help-gnu-emacs@gnu.org; Thu, 16 Mar 2006 11:59:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FJvox-0006Ho-17 for help-gnu-emacs@gnu.org; Thu, 16 Mar 2006 11:59:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FJvow-0006HY-Kr for help-gnu-emacs@gnu.org; Thu, 16 Mar 2006 11:59:30 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FJvtd-0002aP-2Q for help-gnu-emacs@gnu.org; Thu, 16 Mar 2006 12:04:21 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FJvoJ-000814-HB for help-gnu-emacs@gnu.org; Thu, 16 Mar 2006 17:58:51 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Mar 2006 17:58:51 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Mar 2006 17:58:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 24 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33826 Archived-At: Kevin Rodgers wrote: > I wouldn't expect `grep | sed` or awk to be any faster than sed. > My guess is that the performance bottlenecks are (1) splitting the sed > output into a list of strings, (2) running ls on all those file names > (ls sorts its output), and (3) parsing the output in dired. I did a few timing experiments on just the sed command, using a 12MB file like yourself and trying Sun's /usr/bin/sed and /usr/xpg4/bin/sed and GNU's /usr/local/bin/gsed. I was able to get more reliable results by using ^A instead of DEL, and much better performance with this command: sed -n '/^A/!s/^\([^,]*\),[1-9][0-9]*$/\1/p' TAGS ^^ just a single literal Control-A character Another thing I thought of is that you could use the sed command to generate a TAGS-FILES file once, whenever you update the TAGS file. Then, the dired-tags-file command would just need to cat the TAGS-FILE command (or better yet, visit it in a temporary buffer) to get the file names to pass to dired. -- Kevin Rodgers