Boost logo

Boost Users :

From: Lynn Allan (l_d_allan_at_[hidden])
Date: 2006-04-11 12:39:42


<alert comment=<boost newbie">

Xpressive provides a "tips n tricks" to:
Compiling a regex (dynamic or static) is more expensive than executing
a match or search. If you have the option, prefer to compile a pattern
into a basic_regex<> object once and reuse it rather than recreating
it over and over.

Would it be feasible/advantageous for the regex-related libraries to
automagically to "cache" the immediately previous regex compilation?
(or provide as an option)

I've seen code that had the same regex being compiled inside a loop,
which I suppose would really diminish performance. Perhaps this could
be detected, and the user/developer "protected from themselves" ...
and/or perhaps informed that this is happening?

Could there be a "helper" class that somehow or other allowed the last
"n" regexes to be cached? (btw .... what is the plural of regex ....
regexen? regices?)

</alert>


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