On 2011-04-06 at 23:03, Massimo Cora' wrote:
> >Instead of simply adding each colored rectangle and text actor to the
> >larger total
> >group, I make a small container group for each rect and text and then
> >add these to the
> >total group. Performance goes to hell quick.
> >
> >Does anyone have any advice for scrolling large collections of groups
> >around? These
> >groups would become more complex in the future as well with more text and
> >more subgroups.
> >
>
>
> I'm on the same problem. It would be really good if someone could
> provide some 'standard' way to browse a huge number of items in
> collections.
there are no "standard" ways: it mostly depends on the actor's
implementation, whether you're using actors for the elements in the
collection, how's the collection iterated, etc..
there are hints on how to implement actors that can potentially display
large collections:
• try break all operations in batches to avoid blocking the main
loop;
• failing that, use threads to do the blocking operations and
notify the UI through a idle/timeout handler in the main loop;
• do not try to paint actors for items that are offscreen;
• update the actors lazily if they are outside the viewable
region;
• try to reuse objects instead of creating/destroying multiple
instances;
• try to minimize the text computations by avoiding measuring
text multiple times;
• use transformations instead of changes in allocation for
scrolling; make sure you use the apply_transform() vfunc to
avoid breaking input.
in short, it all depends on what your requirements are, and what is your
"budget" in terms of time slices you can devote to updating your UI. in
my experience, there are relatively few instances of "one size fits all"
approach, and views over very large collections is not one of them.
ciao,
Emmanuele.
--
Emmanuele Bassi,
Intel Open Source Technology Center
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list