Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-09-04 21:30:02

Eric Niebler wrote:
> Goran Mitrovic wrote:
>> Is there a speed comparison with
>> ?

I have some preliminary performance numbers at:

This is a comparison of dynamic xpressive, static xpressive and
Boost.Regex, using the latest versions of both libraries in CVS. I'll
see what I can do about getting the numbers for GRETA up there, too.

These numbers were achieved using gcc 3.3.3 (cygwin) on my old laptop.
Why cygwin? Because I'm hitting a buffer overflow trying to compile the
tests on VC7.1. :-P Gotta work around that.

The summary:

- xpressive does well on short string, often beating Boost.Regex by 4x
or more on this test.

- Boost.Regex does well on long string, often beating xpressive by 3x or
more on this test.

- static xpressive usually edges out dynamic xpressive, but not by a lot.

I can't say for certain at this point why xpressive is faster on short
strings and slower on long ones, but I can guess. I haven't spent much
time at this point tuning performance. For xpressive's part, you're
seeing the results of brute-force search. No boyer-moore or
first-and-follow or special-case handling for narrow character sets ...
or anything terribly clever at all. This is clearly hurting xpressive on
the long strings, but these things make less of a difference on short
matches. xpressive is still quite immature in this regard.

I'm very happy with the short string performance, but I bet it's highly
sensitive to hardware/compiler configuration. YMMV.

The code for this test is checked in at /boost-sandbox/libs/xpressive/perf.

Eric Niebler
Boost Consulting

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