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"><<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>></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'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'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 <<a href="mailto:estebanlm@gmail.com">estebanlm@gmail.com</a>> wrote:<br>
> ok, and what about using MagmaDictionary? better? or the same?<br>
><br>
> cheers,<br>
> Esteban<br>
><br>
> El 14/12/2010, a las 5:40p.m., Chris Muller escribió:<br>
><br>
>>>> If I replace MaDictionary with Dictionary, I will be reading/writing the<br>
>>>> full dictionary each time I add an element to the dictionary... isn't?<br>
>><br>
>> Yes, that's true. But a MaDictionary only saves you that if you have<br>
>> a lot of collisions.<br>
>><br>
>>> I think that you need replace MaDictionary with MagmaPreallocatedDictionary<br>
>>> not with standard Dictionary.<br>
>><br>
>> No, this is wrong, please see how MagmaPreallocatedDictionary works.<br>
>> It is for very large dictionary's, Esteban is using a MaDictionary for<br>
>> his root object, and my guess is it only has a few entries in it..<br>
>><br>
>> - Chris<br>
><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>
><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>