Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Does "preallocating hash improve performance"? Or "using a hash slice"?

by vr (Curate)
on Feb 15, 2017 at 19:39 UTC ( [id://1182092]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    keys my %cache = @in;
    $cache{$_} = KEY($_) for @in;
    
  2. or download this
    keys my %cache = @in;
    @cache{@in} = map KEY($_) => @in;
    
  3. or download this
    keys %h = @a;
    @h{ @a } = ... ; # do something useful
    
  4. or download this
    use strict;
    use warnings;
    ...
            },
        })
    }
    
  5. or download this
        Rate   4   3   2   1
    4 1507/s  -- -3% -4% -5%
    ...
    1   1.35  3%  -- -0% -0%
    2   1.35  3%  0%  -- -0%
    3   1.35  3%  0%  0%  --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1182092]
Front-paged by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found