Hi Chris,<br><br>Would a MagmaPreallocatedDictionary be suitable for a collection of say, 100 million names and addresses?<br><br>ching<br><br><div class="gmail_quote">On Wed, Dec 15, 2010 at 10:00 AM, 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">MagmaDictionary is just a normal MagmaCollection with an index on<br>
#hash (actually, #hash32 because its just a 32-bit index).  Please see<br>
it in a hierarchy browser.  As a subclass of MagmaCollection, it<br>
inherits its characteristics...  Which is actually unfortunate because<br>
those characteristics of regular MagmaCollections have highest<br>
throughput when answering _batches_ of rows.  But dictionary&#39;s are<br>
accessed by #at:, just one object at a time.<br>
<br>
This is why I wrote MagmaPreallocatedDictionary.  It is based on a MagmaArray.<br>
<br>
A MagmaArray is an auto-growing, but never shrinking, Array that can<br>
be very large.  Please see the test cases whichh reference MagmaArray<br>
for the actual semantics.<br>
<br>
MagmaArrays are as fast as possible, always just two disk seeks,<br>
6-bytes each, to get the location of the contents of any object.<br>
That&#39;s why MagmaPreallocatedDictionary is much faster than a<br>
MagmaCollection, which is based on a MaHashIndex file-structure for<br>
supporting range-based querying.<br>
<font color="#888888"><br>
 - Chris<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Tue, Dec 14, 2010 at 4:57 PM, Esteban Lorenzano &lt;<a href="mailto:estebanlm@gmail.com">estebanlm@gmail.com</a>&gt; wrote:<br>
&gt; ok, and what about using MagmaDictionary? better? or the same?<br>
&gt;<br>
&gt; cheers,<br>
&gt; Esteban<br>
&gt;<br>
&gt; El 14/12/2010, a las 5:40p.m., Chris Muller escribió:<br>
&gt;<br>
&gt;&gt;&gt;&gt; If I replace MaDictionary with Dictionary, I will be reading/writing the<br>
&gt;&gt;&gt;&gt; full dictionary each time I add an element to the dictionary... isn&#39;t?<br>
&gt;&gt;<br>
&gt;&gt; Yes, that&#39;s true.  But a MaDictionary only saves you that if you have<br>
&gt;&gt; a lot of collisions.<br>
&gt;&gt;<br>
&gt;&gt;&gt; I think that you need replace MaDictionary with MagmaPreallocatedDictionary<br>
&gt;&gt;&gt; not with standard Dictionary.<br>
&gt;&gt;<br>
&gt;&gt; No, this is wrong, please see how MagmaPreallocatedDictionary works.<br>
&gt;&gt; It is for very large dictionary&#39;s, Esteban is using a MaDictionary for<br>
&gt;&gt; his root object, and my guess is it only has a few entries in it..<br>
&gt;&gt;<br>
&gt;&gt; - Chris<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Magma mailing list<br>
&gt; <a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
&gt;<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>
</div></div></blockquote></div><br>