About MagmaPreallocatedDictionary

Facundo Vozzi facundov79 at gmail.com
Mon Dec 20 13:17:23 UTC 2010


Hi Chris,
thanks for your advice. I'll replace it for Dictionary or MagmaDictionary,
It isn't going to have  more than 20000 keys for now.

Do you have a roadmap for the next magma version?

See you,
Facu

On Thu, Dec 16, 2010 at 7:42 PM, Chris Muller <asqueaker at gmail.com> wrote:

> It is important to understand the nuances of using a
> MagmaPreallocatedDictionary.
>
> I must admit I intended it only for myself at the time I wrote it
> under a tight time-constraint; and so did not have time to develop
> what I really wanted..
>
> Note the adjective, "Preallocated", it means all the hash-slots of the
> Dictionary are pre-allocated.  This dictionary will not grow anymore.
> So this means there is a cap to how large it will scale before
> collisions are inevitable, which would rapidly degrade performance.
>
> Thankfully, the size of the support file on disk is actually only as
> large as needs to be to accommodate the *highest-used* hash value.
> Still, you will want to assume the highest-possible hash value could
> be used.
>
> It's 6-bytes per object-pointer so the file is
>
>  6 * [highest-used-hash-value]
>
> bytes in size.  This makes the file on the server a many megabytes
> right out of the gate, but it won't grow again until a higher hash is
> used.
>
> It is absolutely _essential_ that you do not allow any identityHash to
> be part of your hash-calculation.  Otherwise, it won't work;
> identityHash'es are unique between image sessions.
>
> Ultimately, MagmaPreallocatedDictionary will be deprecated.  I would
> like to replace it with a new-and-improved MagmaDictionary based on
> the same concept (employing an underlying MagmaArray), but with a
> better hashing algorithm that allows expansion without rehashing the
> elements.
>
>  - Chris
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/magma/attachments/20101220/03761f7e/attachment.htm


More information about the Magma mailing list