difference between MaDictionary and MagmaDictionary

Chris Muller asqueaker at gmail.com
Wed Dec 15 02:00:37 UTC 2010


MagmaDictionary is just a normal MagmaCollection with an index on
#hash (actually, #hash32 because its just a 32-bit index).  Please see
it in a hierarchy browser.  As a subclass of MagmaCollection, it
inherits its characteristics...  Which is actually unfortunate because
those characteristics of regular MagmaCollections have highest
throughput when answering _batches_ of rows.  But dictionary's are
accessed by #at:, just one object at a time.

This is why I wrote MagmaPreallocatedDictionary.  It is based on a MagmaArray.

A MagmaArray is an auto-growing, but never shrinking, Array that can
be very large.  Please see the test cases whichh reference MagmaArray
for the actual semantics.

MagmaArrays are as fast as possible, always just two disk seeks,
6-bytes each, to get the location of the contents of any object.
That's why MagmaPreallocatedDictionary is much faster than a
MagmaCollection, which is based on a MaHashIndex file-structure for
supporting range-based querying.

 - Chris




On Tue, Dec 14, 2010 at 4:57 PM, Esteban Lorenzano <estebanlm at gmail.com> wrote:
> ok, and what about using MagmaDictionary? better? or the same?
>
> cheers,
> Esteban
>
> El 14/12/2010, a las 5:40p.m., Chris Muller escribió:
>
>>>> If I replace MaDictionary with Dictionary, I will be reading/writing the
>>>> full dictionary each time I add an element to the dictionary... isn't?
>>
>> Yes, that's true.  But a MaDictionary only saves you that if you have
>> a lot of collisions.
>>
>>> I think that you need replace MaDictionary with MagmaPreallocatedDictionary
>>> not with standard Dictionary.
>>
>> No, this is wrong, please see how MagmaPreallocatedDictionary works.
>> It is for very large dictionary's, Esteban is using a MaDictionary for
>> his root object, and my guess is it only has a few entries in it..
>>
>> - Chris
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>


More information about the Magma mailing list