Boost logo

Boost Users :

From: George A. Heintzelman (georgeh_at_[hidden])
Date: 2002-04-16 08:06:52


> > > > Is there anything I can do to speed it up?
>
> Other that use a custom allocator as suggested, probably not. One
> unfortunate side effect of regular expressions is that you pay for
> everything that you *may* use rather than just what you do. In particular
> if you don't want:
>
> a) wide character regexes.
> b) support for backreferences.
> c) support for marked subexpressions.

John,

Speaking as a satisfied user of the regular expression library, always
looking to help make it better:

I was under the impression that point (a) didn't cost anything in
Boost::Regex because it was templatized on the character type. Am I
mistaken? Case (b) is fairly rarely used, but (c) is common. In any
event, it is certainly true that after compiling the regular
expression, you know whether these are needed. So if there are faster
algorithms for these special cases, could they be incorporated into the
library without much overhead?

> C based libraries can also use alloca, which generally gives at least a 2x
> performance increase.

I know that alloca is not 'officially' available in portable C++. But I
think most C++ compilers will handle C-like useages for this construct.
I know we use it successfully on the compilers we use (gcc, Sun CC). So
if there is someplace it would be useful, you could almost certainly
get away with it, probably #ifdef'd around for safety.

George Heintzelman
georgeh_at_[hidden]


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