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

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

by davido (Cardinal)
on Apr 12, 2014 at 17:53 UTC ( [id://1082109]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Benchmark qw(cmpthese);
    
    ...
      copy  => 'my %t = %main::hosts; %t = map { $t{$_} == $main::t_count 
    +? ($_, $t{$_}) : ()} keys %t;',
      nada  => 'my %t = %main::hosts;'
    });
    
  2. or download this
            Rate  copy   map    or    do slice  nada
    copy  1372/s    --  -57%  -57%  -57%  -58%  -78%
    ...
    do    3226/s  135%    2%    0%    --   -0%  -49%
    slice 3236/s  136%    2%    0%    0%    --  -49%
    nada  6289/s  358%   98%   95%   95%   94%    --
    

Log In?
Username:
Password:

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

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

    No recent polls found