Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: speed up one-line "sort|uniq -c" perl code

by Jasper (Chaplain)
on Apr 10, 2003 at 12:57 UTC ( [id://249597]=note: print w/replies, xml ) Need Help??


in reply to speed up one-line "sort|uniq -c" perl code

Just a silly optimisation, really, and I doubt one where your code is losing out greatly, but:
print $_ , $i++ % 2 ? "\n" : "\t" for %h;

Is a bit faster than eaching through the hash.

Jasper

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-06-14 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.