Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Idiomatic optimizations

by thelenm (Vicar)
on Apr 29, 2002 at 18:00 UTC ( [id://162881]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Benchmark qw(cmpthese);
    ...
      'chars'   => sub { $foo =~ /[Aa][Bb][Cc]/og },
      'charvar' => sub { $foo =~ /$re/og },
    });
    
  2. or download this
    Benchmark: timing 1000000 iterations of chars, charvar, i...
         chars:  2 wallclock secs ( 1.97 usr +  0.00 sys =  1.97 CPU) @ 50
    +7614.21/s (n=1000000)
    ...
    charvar 492611/s      --     -3%    -35%
    chars   507614/s      3%      --    -34%
    i       763359/s     55%     50%      --
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found