Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Premature and micro optimization...

by lidden (Curate)
on Jun 11, 2007 at 07:53 UTC ( [id://620433]=note: print w/replies, xml ) Need Help??


in reply to Premature and micro optimization...

Adding the match_and_tr sub missing from your code:
sub match_and_tr { my $string = shift; my( $id, $session ) = split( /\./, $string, 2 ); $id =~ /[a-z]/ and $id =~ tr/a-z/A-Z/; return( $id, $session ); }
I got :
Rate Old way Only TR LC Old way 193050/s -- -8% Only TR LC 209205/s 8% -- Rate Only TR UC Old way U Only TR UC 210084/s -- -2% Old way U 213675/s 2% --

Which is as expected. The sub that don't do any tring is of course faster.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-19 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found