3 Replies Latest reply on Jul 11, 2011 7:37 PM by Shongrunden

    Flex 4 - rendering many rows + cache


      Hi all,


      Currently I am working on a long list, that contains many (custom) rows.


      Since rendering a long list takes a lot of resources, we're using a custom build ItemRenderer technique (it needs to be said that this is not the default ItemRenderer technique that can be used in f.e. DataGroup's. Basically what our list renderer does is checking which part of the list is currently vissible in the viewport and it renders only those rows. When a user scrolls down - so a new part of the list is vissible - it will start rendering those rows, etc. Also, when the user does not scroll for a little while, it will start auto rendering some rows that are not in the viewport untill, eventually, everything is rendered).


      Everything works brilliant, except for this:

      rendering a row takes appr. half a second since the rows are quite complex, and also because a lot of other things are going on in the application.

      Each row consists out of several skinnable containers, with a style applied to each of them. Further on, each rows contains several labels to display text and they have also a custom style applied to them (to color the text, f.e.).


      Since 90% of the rows have the same background (the background basically is a set of several styled skinnable containers) I was wondering if there is a possibility to render the background once, cache that result some how, and then use that cached background for all the other rows. This way, I can prevent that all the rows (1.000's of them) needs to do the same rendering over and over again.


      Does any of you guys have a tip or hint about caching/optimizing this process?


      Thanks a lot in advance.

      Please ask if anything is unclear.