Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^9: elsif chain vs. dispatch

by JavaFan (Canon)
on Apr 28, 2009 at 00:14 UTC ( #760475=note: print w/ replies, xml ) Need Help??


in reply to Re^8: elsif chain vs. dispatch
in thread elsif chain vs. dispatch

Yes, if I understand your point correctly: There is no absolute guarantee that all keys won't hash to the same hash key until the keys are absolutely unique! Correct!
You understood me utterly wrong. The claim was made Perl detects if too many keys hash to the same bucket, the hash is expanded in size and the keys reinserted, spreading over more buckets. I then pointed out that the description of how it's done still means that you can have enough keys map to the same bucket so your lookup isn't constant anymore.
This idea that say 256 things will hash into an identical hash table entry is unlikely. Now "very, very seldom" doesn't mean "never".
Yes, and? We were talking about a worst case scenario. And a worst case scenario could be anything that doesn't never happen.


Comment on Re^9: elsif chain vs. dispatch
Re^10: elsif chain vs. dispatch
by Marshall (Prior) on Apr 28, 2009 at 04:49 UTC
    The claim was made Perl detects if too many keys hash to the same bucket, the hash is expanded in size and the keys reinserted, spreading over more buckets.

    Where did that idea come up?

    If Perl detects num_entries > num_buckets, that will trigger more buckets.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://760475]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-07-23 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls