Last updated at 12:16 am UTC on 15 August 2011
A MagmaPreallocatedDictionary is a very special-purpose dictionary where performance is of utmost importance. MagmaPreallocatedDictionary provides O(1) access and the very fastest-possible access for this type of structure in the context of the Magma environment. Very simply, it is a standard Dictionary implementation except substituting a MagmaArray instead of the standard Array.
It is important to understand the nuances of using a MagmaPreallocatedDictionary. Note the adjective, "Preallocated", it means all the hash-slots of the Dictionary are pre-allocated. This dictionary will not grow anymore, meaning there is a cap to how large it will scale before
collisions are inevitable, which would begin to 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
It's 6-bytes per object-pointer so the file is
bytes in size. This makes the file on the server about 200 megabytes
after adding the first object, but it won't grow again until a higher hash is
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 differ between image sessions.