RegExp performance

Brian Crowder thekrelin at gmail.com
Tue Jun 24 10:20:45 PDT 2008


Spidermonkey's jsregexp.c is (we've been much surprised to find out) 
very fast.  It currently still beats even the very latest releases we've 
seen of regexp engines in other JS implementations, as far as I know.  
The code is unpleasant to work in and very fragile, however.

Has anyone taken a look at boost::xpressive?

Here's a snippet from the "dynamic regexexes" section of the documentation:
   "Since the dynamic syntax is not constrained by the rules for valid 
C++ expressions, we are free to use familiar syntax for dynamic regexes. 
For this reason, the syntax used by xpressive for dynamic regexes 
follows the lead set by John Maddock's proposal  to add regular 
expressions to the Standard Library. It is essentially the syntax 
standardized by ECMAScript, with minor changes in support of 
internationalization."

Beware, I've not investigated much beyond this, though I have been 
watching boost::regex and this newer regex library, boost::xpressive, 
for a while.  boost::regex also has an ECMAScript compatibility mode, 
iirc, but I believe it is being deprecated in favor of boost::xpressive.

-- crowder

Steven Johnson wrote:
> Re: the heap vs stack, I have a vague memory of Flash avoiding the stack
> usage due to pathological cases being able to use too much stack space...
> but I'd have to check the bugbase to be sure.
>
> Re: PCRE, I don't think anyone is married to it. Flash will definitely have
> a backwards-compatibility requirement and so would prefer something that can
> be compatible, but otherwise we're definitely open for changes. Now all we
> need is a volunteer :-)
>    


More information about the Tamarin-devel mailing list