Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Premature and micro optimization...

by chargrill (Parson)
on Jun 11, 2007 at 05:36 UTC ( [id://620413]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub id_parse {
      my $string = shift;
      return split( /\./, $string, 2 );
    }
    
  2. or download this
    sub id_parse {
      my $string = shift;
    ...
      $id =~ tr/a-z/A-Z/;
      return( $id, $session );
    }
    
  3. or download this
    #!/usr/bin/perl
    
    ...
        'Old way  U' => $old_upp,
      },
    );
    
  4. or download this
                   Rate Old way    Only TR LC
    Old way    280899/s         --       -21%
    ...
                   Rate Old way  U Only TR UC
    Old way  U 340136/s         --        -4%
    Only TR UC 354610/s         4%         --
    
  5. or download this
    sub micro {
      my $string = shift;
      my( $id, $session ) = split( /\./, $string, 2 );
      return( $id, $session );
    }
    
  6. or download this
                   Rate Old way    Only TR LC Micro Optm
    Old way    277778/s         --       -21%       -28%
    ...
    Old way  U 340136/s         --        -4%       -12%
    Only TR UC 354610/s         4%         --        -8%
    Micro OptU 384615/s        13%         8%         --
    
  7. or download this
    $ perl -MO=Concise -e '
    sub foo {
    ...
    -           <1> ex-rv2cv sK/1 ->-
    5              <#> gv[*foo] s ->6
    -e syntax OK
    
  8. or download this
    s**lil*;  $*=join'',sort split q**;  s;.*;grr; &&s+(.(.)).+$2$1+; $; =
    qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
    

Log In?
Username:
Password:

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

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

    No recent polls found