Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

alternation in regexes: to use or to avoid?

by dk (Chaplain)
on Dec 10, 2012 at 14:42 UTC ( [id://1008105]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
            }
        },
    });
    
  2. or download this
    Benchmark: timing 100000 iterations ...
    alternation, grouping: 12 wallclock secs (11.92 usr +  0.00 sys = 11.9
    +2 CPU) @ 8389.26/s (n=100000)
    alternation, no grouping:  0 wallclock secs ( 0.19 usr +  0.00 sys =  
    +0.19 CPU) @ 526315.79/s (n=100000)
                (warning: too few iterations for a reliable count)
    loop, grouping:  2 wallclock secs ( 1.33 usr +  0.00 sys =  1.33 CPU) 
    +@ 75187.97/s (n=100000)
    loop, no grouping:  1 wallclock secs ( 1.33 usr +  0.00 sys =  1.33 CP
    +U) @ 75187.97/s (n=100000)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1008105]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found