-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 9/29/2007 1:31 PM: > Here's something a bit more telling. With the attached patch, and in the > coreutils directory, > > $ M4_TRACE_FILE=~/m4.trace M4=~/m4/src/m4 autoconf > $ wc m4.trace > 62207 61314 666720 m4.trace > $ sort -u m4.trace | wc > 401 405 5619 > $ sort <m4.trace | uniq -c |sort -n -k1,1 |tail -n 15 > 740 [\\''] > 816 (.*) > 863 > ^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*$ > 1163 \(..\)$ > 1163 \\ > 1163 ^\(..\) > 2244 [^a-zA-Z0-9_] > 2324 [ ]+ > 3242 > 4306 \\[`""] > 5020 [`""] > 5020 \\[\\$] > 7376 [`$] > 11504 @\(<:\|:>\|S|\|%:\)@ > 11915 @&t@
After this week's autoconf patches, the regex count when running autoconf on coreutils is now: $ wc m4.trace 7759 12439 90000 m4.trace $ sort -u m4.trace|wc 34 43 650 $ sort m4.trace | uniq -c |sort -n -k1,1 |tail -n20 25 r:n:{[:;]} 36 p:y:{:} 36 r:n:{:} 38 p:y:{:.*\(.\)$} 39 p:y:{[\"$`]} 41 r:n:{\.} 50 p:y:{\([0-9]+\)\([abcdefghi]\)} 50 p:y:{\([0-9]+\)\([jklmnopqrs]\)} 50 p:y:{\([0-9]+\)\([tuvwxyz]\)} 98 p:y:{.} 122 p:n:{\..*} 122 p:n:{^[^.]*\.} 127 p:y:{[`""]} 287 p:y:{[\\`]} 364 p:n:{(.*)} 397 p:y:{[\\'']} 1163 p:n:{\\ 1163 p:y:{^. ?\(.*\) .$} 1164 } 2324 p:y:{[ ]+} Of the above list, the first line which doesn't represent multi-character replacement or true regex pattern searching is 98 p:y:{.} (from m4_text_box); the returns for fixing this, or any other low-frequency pattern, to avoid regexes is probably too small to be worth the effort. I don't see any more obvious speed improvements on the autoconf side of things (although the m4 side of things can probably be improved; just hanging on to the last 4 most recently compiled regex should probably speed things up). For my next autoconf-patches thread, I'll optimize autom4te - --language=autotest :) - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHBN/j84KuGfSFAYARAvzTAJ0SsrZkhH42mzO4TIwS4Ek25qBHXgCeO7WA 97TXyAG98WrRXG8MFpD9yGk= =3scw -----END PGP SIGNATURE----- _______________________________________________ M4-discuss mailing list M4-discuss@gnu.org http://lists.gnu.org/mailman/listinfo/m4-discuss