Be Careful with Renderers

17 06 2009

After we added one fancy renderer to ADG to highlight our search results in case user performed a search I noticed that vertical scrolling slowed down way too much.

After some investigation we found the culprit: in case when no search was performed the renderer filled the cells with white solid fill using beginFill() and endFill(). We substituted this to just graphics.clear() and everything was fixed. So it appears that beginFill() – endFill() is quite expensive though primitive operation. Not funny :)


Actions

Information

2 responses

30 07 2009
simon

Might be that the clear() method was just never called, so the drawRect’s accumulate each time.

6 08 2009
Alexander Arendar

Yep, it may be a case.

Leave a comment