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