Hello!

I have a container that renders data, with renderers positioned absolutely (i.e. a diagram). The optimization need is basically the same as with any other container: recycling renderers.

My approach is the following: on every updateDisplayList(), I scan the list of model elements, to see * what are the models that are in the current viewable area (according to the scroll bar positions); among them there are
  ** A) model elements that have a renderer and
** B) model elements that haven't got a renderer (e.g. he have just scrolled in that area)
* what are the model elements that are not in the viewable area C)

Then I reuse the renderers C, for the model elements B (i.e. they only change the position). Of course, new renderers may be added, if the ones that already exist (C) are not enough.

My problem is that scrolling (on mobile and even on the web version) is not very smooth. Have you got any hints regarding:
* Is "updateDisplayList()" the correct place to do this kind of processing?
* I guess that the fastest way to reuse a renderer is to change its position, right? Removing it or adding it to the parent: are operations that are more expensive, right? * Are there any other similar mechanisms which I could reuse our inspire from?

Thank you in advance.
Best regards,
Cristian.

Reply via email to