MagmaCollectionReader>>size takea a long time

Burella Juan M. juan.burella at gmail.com
Fri Aug 31 22:22:18 UTC 2007


Thanks Igor for your answer.

If calculating a MagmaCollectionReader size is costly, then why not forward
#size to its MagmaCollection?
My problem is I'm sending #size to a MagmaCollectionReader because I need to
paginate the collection for showing its contents in the UI. Any suggestions?

Thanks
Juan M.

On 8/31/07, Igor Stasenko <siguctua at gmail.com> wrote:
>
> use collection.
> a #size for MagmaCollectionReader is not something which can be fast,
> because collectionreader designed for reading/filtering collections
> with provided filter query. It's impossible to determine the number of
> items in filtered collection in other way than reading and testing
> full collection, thats why #size is bad practice for using with
> collectionreader. It designed for sequential reading, not for random
> access.
>
>
> On 31/08/2007, Burella Juan M. <juan.burella at gmail.com> wrote:
> > Hi list,
> >
> >       I have a indexed MagmaCollection ( it has about 11,000 objects). I
> > have noticed that requesting the size to a MagmaCollectionReader takes a
> > long time whereas the same requesting to a MagmaCollection doesn´t
> >
> >  For example:
> >
> > "MagmaCollection>>size - fiirst evaluation"
> > [ (magmaSession root at: #Serial) size ] timeToRun  "answer about 525
> > milliseconds"
> > "Note: magmaSession root at: #Serial answer a MagmaCollection"
> >
> >
> > "second evaluation"
> > [ (magmaSession root at: #Serial) size ] timeToRun  "answer about
> > 1milliseconds"
> >
> > "MagmaCollectionReader>>size  first evaluation"
> > [ ((magmaSession root at: #Serial) read: #issnString) size ] timeToRun
> > "answer about 9798 milliseconds"
> >
> > "second evaluation"
> > [ ((magmaSession root at: #Serial) read: #issnString) size ] timeToRun
> > "answer about  8992 milliseconds"
> >
> > Any suggestions for reducing this time?
> >
> > Thanks in advance.
> > Juan Matias.
> >
> > _______________________________________________
> > Magma mailing list
> > Magma at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/mailman/listinfo/magma
> >
> >
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/magma/attachments/20070831/b799e04d/attachment.htm


More information about the Magma mailing list