Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Craftier

by BatGnat (Scribe)
on Dec 15, 2000 at 03:53 UTC ( #46757=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Benchmark;
    my $junk = 'The quick brown fox Jumped over the lazy dog';
    timethese(5000000,
    ...
        'regex1'    => '$junk =~ tr/\s//;',
        'regex2'    => '$junk =~ s/\s//g;',
    });
    
  2. or download this
    Benchmark: timing 5000000 iterations of regex1, regex2, split...
        regex1:  3 wallclock secs ( 4.38 usr +  0.00 sys =  4.38 CPU) @ 11
    +42334.93/s (n=5000000)
        regex2:  3 wallclock secs ( 3.50 usr +  0.00 sys =  3.50 CPU) @ 14
    +26940.64/s (n=5000000)
         split: 15 wallclock secs (15.07 usr +  0.00 sys = 15.07 CPU) @ 33
    +1762.99/s (n=5000000)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-10-23 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls