Boost logo

Boost :

Subject: Re: [boost] [regex, xpressive] interesting(?) perf benchmark
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-07 08:59:45

On 6/7/2010 5:50 AM, Mathias Gaunard wrote:
> Le 07/06/2010 04:58, Eric Niebler wrote:
>> I'm always suspect of benchmarks, but I figured I'd post this anyway.
> Just an idea: for static xpressive, couldn't you detect at compile-time
> that the expression is truly regular, and use a DFA in that case?

Oh, sure! Why don't you submit a DFA and I'll use it in xpressive? ;-)

After nosing about on the internet a bit more, I found this interesting

Here we see every language compared on how well it can perform on a
particular regex task. The top-performer is <drumroll> Google's
JavaScript V8 engine! Wow. C++ is in 5th place. The fastest C++ program
submitted to the competition uses static xpressive <pats own back>. I'm
not so upset about being beaten by V8. It adaptively improves its native
codegen *at runtime*. What really bugs me is that we're skunked by a C
library: Tcl. Grrrr. I've read a bit about Tcl's regex library; it does
what Mathias is suggesting: implements both a DFA and an NFA, analyzes
the pattern and chooses which to use. I've known for a while that this
is the way forward, but I just don't have the time for that. (Wasn't
there a GSoC project to do that for Boost.Regex?)

Eric Niebler
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at