[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bracket expressions with character ranges are slow
From: |
Seth David Schoen |
Subject: |
Re: Bracket expressions with character ranges are slow |
Date: |
Sat, 7 May 2011 23:21:29 -0700 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Seth David Schoen writes:
> That is, using the explicit list of characters in the backet
> expression was three orders of magnitude faster! Using the
> character class [:upper:] is also fast:
>
> address@hidden:~$ time grep '[:upper:]' /usr/share/dict/words > /dev/null
I was wrong about that -- my grep doesn't have the patch from
https://lists.gnu.org/archive/html/bug-grep/2010-09/msg00015.html
so it didn't warn me that I wasn't actually using the character
class I thought I was. In fact, using the character class [[:upper:]]
is also _slow_, about as slow as using the range [A-Z].
--
Seth David Schoen <address@hidden> | Qué empresa fácil no pensar en
http://www.loyalty.org/~schoen/ | un tigre, reflexioné.
http://vitanuova.loyalty.org/ | -- Borges, El Zahir