Boost logo

Boost Users :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-01-29 21:31:45


Eric Niebler wrote:
> Robert Ramey wrote:
>> I have sort of a dumb question about this. What would be the motivation for
>> using Xpressive if its not faster than regex? Putting it another way, I
>> would have thought that Xpressive would be faster with the cost of more code
>> being instantiated every time it's invoked.
<snip>

I've already largely answered this in a previous message, but I wanted
to add that depending on how you use xpressive, you may end up with
*less* code instantiated than with boost.regex. That's because with
static regexes, you only pay for the features you use, but with
boost.regex, you have pay for everything up front. On the other hand, if
you have lots of complicated static regexes, the code can get big.

Finally, there actually is a measurable performance difference between
boost.regex and xpressive in this case, even after John's tweaks:

Boost.regex: 3.411
Boost.xpressive (dynamic): 3.015
Boost.xpressive (static): 2.949

So as you initially thought, static xpressive is marginally faster in
this case. On my hardware. In this phase of the moon. Until John one-ups
me again. ;-)

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net