Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by davido (Cardinal)
on Apr 12, 2014 at 17:53 UTC ( #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
Node Status?
node history
Node Type: note [id://1082109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-11-28 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?