Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Regexp optimization - /o option better than precompiled regexp? (analysis)

by tye (Cardinal)
on Jun 28, 2010 at 19:31 UTC ( #846966=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Readonly my $REGEXP_READONLY => '999986';
      if( $l_line =~ m/$REGEXP_READONLY/ ) {
    ...
      if( $l_line =~ m/$l_search/o ) {
        # 0.69s - CORE:regcomp
        # 0.76s - CORE:match
    
  2. or download this
        # 0.91s - CORE:match  if( $l_line =~ m/$REGEXP_READONLY/ ) {
        # 0.75s - CORE:match  if( $l_line =~ m/${\REGEXP_CONSTANT}/ ) {
    ...
        # 0.78s - CORE:match  if( $l_line =~ $l_search_r ) {            # 
    +qr//
        # 0.76s - CORE:match  if( $l_line =~ m/$l_search/ ) {
        # 0.76s - CORE:match  if( $l_line =~ m/$l_search/o ) {          # 
    +/o
    
  3. or download this
        # 5.78s - CORE:regcomp if( $l_line =~ m/$REGEXP_READONLY/ ) {
        # 0.74s - CORE:regcomp if( $l_line =~ m/${\REGEXP_CONSTANT}/ ) {
    ...
        # 1.33s - CORE:regcomp if( $l_line =~ $l_search_r ) {           # 
    +qr//
        # 0.74s - CORE:regcomp if( $l_line =~ m/$l_search/ ) {
        # 0.69s - CORE:regcomp if( $l_line =~ m/$l_search/o ) {         # 
    +/o
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://846966]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-08-20 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (111 votes), past polls