http://www.perlmonks.org?node_id=1064827


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'