MagmaPreallocatedDictionary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MagmaPreallocatedDictionary

fvozzi
Hi Chris, list,
how can I do to send #select: to a MagmaPreallocatedDictionary? 

Thanks,
Facu

_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma
Reply | Threaded
Open this post in threaded view
|

Re: MagmaPreallocatedDictionary

fvozzi
I change MagmaPreallocatedDictionary to standard Dictionary and all seem works fine again because I need (for one report) find customers by names. What do you think about smalltalk standard dictionary persistent on Magma? 

Did you think about a Dictionary (MagmaDictionary?) with its values on a MagmaCollection so we would get access by hashed key or by an index on its values?

See you,
Facu



On Sun, Dec 12, 2010 at 12:35 AM, Facundo Vozzi <[hidden email]> wrote:
Hi Chris, list,
how can I do to send #select: to a MagmaPreallocatedDictionary? 

Thanks,
Facu


_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma
Reply | Threaded
Open this post in threaded view
|

Re: MagmaPreallocatedDictionary

Chris Muller-3
Hi Facu, with standard Smalltalk collections there is just one
"Buffer" for the whole Collection object, so every time an element is
added, the "whole object" is changed and it writes a new buffer out.
So one-million elements might be an issue unless it is all built
up-front and not updated much anymore, since concurrent updates to a
single object also results in a commit-conflict, which you don't get
if you use a MagmaCollection or MagmaPreallocatedDictionary.

Also don't forget it is perfectly reasonable to make as many
object-pointers as you need even to the same objects; this is where
ODBMS's excel.  So you can have more than one collection with the same
objects.  So use the best collection for the job in each case.  If you
need to "find customers by names" then I would, in fact, use a
MagmaCollection with a index on name.  If you need the high-speed
single-object access, you should also put the same objects into the
MagmaPreallocatedDictionary.

 - Chris


On Sun, Dec 12, 2010 at 2:48 PM, Facundo Vozzi <[hidden email]> wrote:

> I change MagmaPreallocatedDictionary to standard Dictionary and all seem
> works fine again because I need (for one report) find customers by names.
> What do you think about smalltalk standard dictionary persistent on Magma?
> Did you think about a Dictionary (MagmaDictionary?) with its values on a
> MagmaCollection so we would get access by hashed key or by an index on its
> values?
> See you,
> Facu
>
>
>
> On Sun, Dec 12, 2010 at 12:35 AM, Facundo Vozzi <[hidden email]>
> wrote:
>>
>> Hi Chris, list,
>> how can I do to send #select: to a MagmaPreallocatedDictionary?
>> Thanks,
>> Facu
>
> _______________________________________________
> Magma mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>
_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma
Reply | Threaded
Open this post in threaded view
|

Re: MagmaPreallocatedDictionary

fvozzi

Also don't forget it is perfectly reasonable to make as many
object-pointers as you need even to the same objects; this is where
ODBMS's excel.  So you can have more than one collection with the same
objects.  So use the best collection for the job in each case.  If you
need to "find customers by names" then I would, in fact, use a
MagmaCollection with a index on name.  If you need the high-speed
single-object access, you should also put the same objects into the
MagmaPreallocatedDictionary.

Yes, I was thinking about it. Maybe I'm going to have an overhead maintaining that structures but It's a good price to paid for better performance in this case.


 - Chris


See you,
Facu

_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma