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

Re: Re: Re: Idiomatic optimizations

by thelenm (Vicar)
on Apr 30, 2002 at 16:59 UTC ( #163127=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);
      'i'       => sub { $text =~ /abc/ig },
      'chars'   => sub { $text =~ /[Aa][Bb][Cc]/g },
  2. or download this
    Benchmark: timing 10 iterations of chars, i...
         chars: 40 wallclock secs (38.37 usr +  0.04 sys = 38.41 CPU) @  0
    +.26/s (n=10)
          s/iter chars     i
    chars   3.84    --  -70%
    i       1.14  236%    --

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2016-10-28 21:12 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.