Hi Chris,<div>thanks for your advice. I&#39;ll replace it for Dictionary or MagmaDictionary, It isn&#39;t going to have  more than 20000 keys for now.</div><div><br></div><div>Do you have a roadmap for the next magma version?</div>
<div><br></div><div>See you,</div><div>Facu</div><div><br><div class="gmail_quote">On Thu, Dec 16, 2010 at 7:42 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">It is important to understand the nuances of using a<br>
MagmaPreallocatedDictionary.<br>
<br>
I must admit I intended it only for myself at the time I wrote it<br>
under a tight time-constraint; and so did not have time to develop<br>
what I really wanted..<br>
<br>
Note the adjective, &quot;Preallocated&quot;, it means all the hash-slots of the<br>
Dictionary are pre-allocated.  This dictionary will not grow anymore.<br>
So this means there is a cap to how large it will scale before<br>
collisions are inevitable, which would rapidly degrade performance.<br>
<br>
Thankfully, the size of the support file on disk is actually only as<br>
large as needs to be to accommodate the *highest-used* hash value.<br>
Still, you will want to assume the highest-possible hash value could<br>
be used.<br>
<br>
It&#39;s 6-bytes per object-pointer so the file is<br>
<br>
  6 * [highest-used-hash-value]<br>
<br>
bytes in size.  This makes the file on the server a many megabytes<br>
right out of the gate, but it won&#39;t grow again until a higher hash is<br>
used.<br>
<br>
It is absolutely _essential_ that you do not allow any identityHash to<br>
be part of your hash-calculation.  Otherwise, it won&#39;t work;<br>
identityHash&#39;es are unique between image sessions.<br>
<br>
Ultimately, MagmaPreallocatedDictionary will be deprecated.  I would<br>
like to replace it with a new-and-improved MagmaDictionary based on<br>
the same concept (employing an underlying MagmaArray), but with a<br>
better hashing algorithm that allows expansion without rehashing the<br>
elements.<br>
<br>
 - Chris<br>
_______________________________________________<br>
Magma mailing list<br>
<a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
</blockquote></div><br></div>