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@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@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
-- Best regards, Igor Stasenko AKA sig.
On 8/31/07, Igor Stasenko siguctua@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.
This is so wrong. Please read the section "Optimizing Performance" in the documentation about querying MagmaCollections.
Juan, please the section "Optimizing Performance" in the documentation about querying MagmaCollections to understand when #size will be very fast vs. pretty slow.
http://wiki.squeak.org/squeak/5859
For the cases that are "pretty slow" (i.e., a Reader requiring distinct results), note you have #lastKnownSize, which is the cached size (therefore instant access).
- Chris
On 8/31/07, Burella Juan M. juan.burella@gmail.com wrote:
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@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@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@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/magma
-- Best regards, Igor Stasenko AKA sig.
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
magma@lists.squeakfoundation.org