|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re^2: When does Perl double the number of buckets in hash?by ikegami (Pope) |
| on Dec 01, 2011 at 00:36 UTC ( #940976=note: print w/ replies, xml ) | Need Help?? |
|
As shown by the code the OP posted, it actually happens when the number of elements (including the newly inserted element) is equal to the number buckets. What the OP missed is that it only happens if there's a collision. Using your numbers:
There's a second condition that causes a split: A degenerate hash is detected. A degenerate hash is one that has a bucket with so many element as to make it slow to find keys in that bucket. I didn't try to determine the exact condition for when this occurs.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||