[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding files with tags
From: |
Kevin Rodgers |
Subject: |
Re: Finding files with tags |
Date: |
Thu, 16 Mar 2006 09:57:28 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
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