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

Re: map {} list or do {} for list? - Benchmarks

by Random_Walk (Prior)
on Apr 12, 2014 at 12:32 UTC ( [id://1082078]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
                   Rate  or delete        do      copy     slice       map
    or delete 1620746/s         --       -1%      -50%      -71%      -78%
    ...
         copy 3215434/s        98%       96%        --      -42%      -56%
        slice 5555556/s       243%      238%       73%        --      -24%
          map 7299270/s       350%      345%      127%       31%        --
    
  2. or download this
    #!/usr/bin/perl 
    use strict;
    ...
        '    slice' => ' delete @hosts{ grep { $hosts{$_} != $t_count } ke
    +ys %hosts }               ',
        '     copy' => ' %hosts = map { $hosts{$_} == $t_count ? ($_, $hos
    +ts{$_}) : ()} keys %hosts ',
    });
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found