Modify

Opened 11 years ago

Closed 11 years ago

#697 closed Support Requests (Fixed)

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 (0)

Change History (1)

comment:1 Changed 11 years ago by John Maddock

Status: assignedclosed
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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain nobody.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.