On 21 February 2002, Arpi said:
> anyway, i have a request:
> could you add a new rule type, for plain text matches?
> searching for a text string is always simpler and faster than for regexps,
> and many of your regexps are such strings (/some words/i) and there will be
> much more when start adding multiple-rule things.

That sounds like a good idea, but I would do some timing tests first to
make sure it's worthwhile.  I would not be at all surprised to find out
that
   /word/

is just as fast in Perl as a simple substring match.  Perl has been
optimized to hell and back again for chewing through text as quickly as
possible, and you might be better off writing smarter (simpler) regexes
than trying to outsmart Perl.

Note that PCRE is not the fastest regex engine in the world.  Lots of
people noticed a slowdown when Python switched to using PCRE in version
1.5; when it switched to a new Unicode-based regex engine in 2.0 (or was
it 1.6?), it got faster again.  So in your C version, a simple substring
match might be a win.

Hmmm: you *could* just look for /.../ where the ... contains no regex
metacharacters, and turn it into a substring search to avoid PCRE when
it's not needed.

        Greg
-- 
Greg Ward - software developer                [EMAIL PROTECTED]
MEMS Exchange                            http://www.mems-exchange.org

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to