Modify

Ticket #697 (closed Support Requests: Fixed)

Opened 8 years ago

Last modified 8 years ago

performance of boost::regex

Reported by: nobody Owned by: nobody
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

Is there any differenc between PERL and POSIX 
regarding the speed of the matching? does the flag 
match_posix affect it?

Does regex implement Knuth-Morris-Pratt or any other 
string matching algorithm? Is there such in boost at 
all?

Cheers, Doris.

Attachments

Change History

comment:1 Changed 8 years ago by johnmaddock

  • Status changed from assigned to closed
Logged In: YES 
user_id=14804

Yes there is a difference between Perl and Posix style
matching: Boost.Regex is basically a Perl style matcher that
supports POSIX style matching as an optional extra.  So Perl
style matches are always faster in this implementation.

Boost.Regex did previously use the Knuth_Morris-Pratt
algorithm for regexes that have a string literal prefix. 
However, that code is currently disabled in the source. 
Believe it or not it's actually slower in practice than a
simple table-based scan.

HTH, John.
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.