Monthly Archives: December, 2007

TileList is changed to recycle rows in Moxie

That’s right, the TileList has gone green. In the past release, DataGrid and List have already been recycling their rows to give these components better performance. However, the TileList (and HorizontalList) were not recycling rows. This change came about when customer filed a bug (SDK-13887), regarding a memory leak in the TileList component when it used itemRenderers. This bug was causing a serious lag when you had a lot of data and began scrolling in the component.

Alex Harui made the change to add the recycling of rows in changelist 190557. So, you should see a big improvement in the performance of this component. Note that this change did not make our public Beta 3 build (which will be out to the public soon). But, you will see the change in our nightly builds on labs and in the final build of Moxie.

How will this change affect you? Well, in theory, other than the performance improvement, you shouldn’t see any change in your Application. However, we all write bad code sometimes and if you have written an itemRenderer that makes assumptions that each itemRenderer is only associated with one piece of data, then, you might see some unexpected behavior. For example, in a set data function, you might have code like this:

if (data.quantity < 10)
    setStyle("fontWeight", "bold");

You will need to change your code to do this:

if (data.quantity < 10)
    setStyle("fontWeight", "bold");
else
    setStyle("fontWeight", "normal");

The details on best practices when writing itemRenderers can be found on Alex Harui’s blog. The link takes you to a posting that specifically talks about recycling itemRenderers and how to take this into account in your code.

Update: Use Fade without embedding fonts was reverted

Well, I spoke too soon in my last blog entry. While this fix was checked in, it was reverted a few days later. Per some internal discussions regarding new bugs that came up after the fix as well as performance ramifications, it was decided that this was too much of a risk to change. We are hitting the end of Flex 3, so, major changes aren’t being made anymore. Hopefully, we can find a better solution next release since I still believe that this is a problem that we should fix.

So, thanks to those who commented on my last entry. You were pretty much dead on about some of the problems that this change would cause. 🙂

By the way, I’ve been on vacation for the past two weeks and have therefore not responded to any comments or written new content.