Can anybody tell me which one has better performance?
Well it depends what you mean :-)
Just my - entirely biased - 2c, John Maddock.
I think the original poster would have gotten a more interesting response asking for a comparison of Boost and Greta :) I've used both but don't have much to say except that I've found that for certain regex subsets, and I'm sure this comes as no surprise, it is possible to get a big speed improvement by writing specialized code. Obviously, you don't need the regex code to find fixed, single, items and you can compile or index the expression or search string to great benefit in many cases- esp if you have thousands of queries against the same expression and can re-organize memory accesses to keep the cache more stable. Maybe the Greta or Boost people have particular references in this area they could share. I've written some code for ad hoc subsets and it makes a given application practical but there are probably more systematic approaches to the problem. I'm not sure if there is a regex evaluator that takes a vector of queries and expressions and optimizes the algorithm depending on operands.
From: john@johnmaddock.co.uk To: boost-users@lists.boost.org Date: Thu, 22 Nov 2007 09:46:53 +0000 Subject: Re: [Boost-users] boost.regex vs perl
Jin Sun wrote:
Can anybody tell me which one has better performance?
Well it depends what you mean :-)
I'd be surprised if there was much difference between the core regex engines: maybe one would be slightly better at some things the other at different things. Where you gain with Boost.Regex is in the ability to write the surrounding code in a compiled language rather than have it interpreted. Whether you succeed in making your app faster as a result will mainly depend on how cunning you are at avoiding unnecessary copying/memory allocations in your code logic: to put it another way, badly written C++ can be the slowest thing around, while well written code can be as fast as any language out there.
Oh, and not all regular expressions are created equal: if the problem is the speed of the regex matching, then it's likely a problem with the regex you're using.
Just my - entirely biased - 2c, John Maddock.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_________________________________________________________________ Put your friends on the big screen with Windows Vista® + Windows Live™. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_...