Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: better union of sets algorithm?

by Anonymous Monk
on Mar 11, 2005 at 10:17 UTC ( [id://438588]=note: print w/replies, xml ) Need Help??


in reply to Re^4: better union of sets algorithm?
in thread better union of sets algorithm?

Also its worth remembering that every time you use a unique key in _any_ hash _anywhere_ that key will be inserted into a second hash structure that is used to store the keys.

No, buckets are linked lists, not secondary hashes.

Replies are listed 'Best First'.
Re^6: better union of sets algorithm?
by demerphq (Chancellor) on Mar 11, 2005 at 10:30 UTC

    By default build perl shares keys accross all hashes. That way when you have a zillion hashes with the same keys the keys arent duplicated in memory. To store all those keys it uses another hash that really holds the keys. So when you insert a new key into your hash its hash number is calculated and then that number is used to store into both hashes. Which means that hash has to grow as well.

    ---
    demerphq

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-19 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found