Re: How to rewrite a regexp without word boundaries?

Tony Finch <dot@dotat.at>
16 Aug 2009 16:58:09 +0100 (BST)

          From comp.compilers

Related articles
[2 earlier articles]
Re: How to rewrite a regexp without word boundaries? dave_140390@hotmail.com (2009-07-06)
Re: How to rewrite a regexp without word boundaries? haberg_20080406@math.su.se (Hans Aberg) (2009-07-07)
Re: How to rewrite a regexp without word boundaries? h.b.furuseth@usit.uio.no (Hallvard B Furuseth) (2009-07-07)
Re: How to rewrite a regexp without word boundaries? andrew@tomazos.com (Andrew Tomazos) (2009-07-07)
Re: How to rewrite a regexp without word boundaries? cfc@shell01.TheWorld.com (Chris F Clark) (2009-07-13)
Re: How to rewrite a regexp without word boundaries? hu47121@usenet.kitty.sub.org (2009-08-16)
Re: How to rewrite a regexp without word boundaries? dot@dotat.at (Tony Finch) (2009-08-16)
| List of all articles for this month |
From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers,comp.theory
Date: 16 Aug 2009 16:58:09 +0100 (BST)
Organization: dotat labs
References: 09-07-003 09-07-008 09-07-011 09-08-023
Keywords: lex, performance, comment
Posted-Date: 16 Aug 2009 17:49:06 EDT

>[Spamassassin has an option to compile its patterns with re2c and link
>that into perl. It takes the better part of an hour to compile, but it
>runs really fast. -John]


On my 2Ghz Xeon E5335 server it takes 15 seconds to download an updated
ruleset and compile it using re2c.


Regarding the performance of parsing engines, the PEG formalism is
nice in that it gives the programmer much more straightforward control
over backtracking than perl-style regexes and nuch more predictable
performance, while allowing small and fast implementations (e.g. LPEG).


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
[I timed it, it's not an hour, on my server it takes about 15 seconds to run re2c to create the C
source, but iover 15 minutes to compile and link that. Still hugely worth it for spamassassin which
runs several times per minute. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.