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

Re: Faster Hash Slices

by shmem (Canon)
on Nov 28, 2013 at 13:50 UTC ( #1064827=note: print w/replies, xml ) Need Help??


in reply to Faster Hash Slices

What Eily says. Then, according to perldata:

You can preallocate space for a hash by assigning to the keys() function. This rounds up the allocated buckets to the next power of two:
keys(%users) = 1000; # allocate 1024 buckets

I'm not sure about the impact on performance, though.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064827]
help
Chatterbox?
shmem throws a bavarian hesh bug at thezip
[shmem]: note how only a change of rhytm and from mayor to minor makes cuban out of bavarian ;-)
[shmem]: well, cadences are a bit different, also. But those are frills, too.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2017-04-27 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (512 votes). Check out past polls.