Performance Issues Using the Flex Component Kit for Flash

On a recent project I was implementing some skins into an AIR application. Things were moving forward without any problems until recently when the lead developer on the project, Greg Owen, walked up to me and asked about potential performance issues with skinning. I asked what the issue was and he mentioned a major CPU hit was being taken as soon as the style sheet was loaded and it just continued to climb. He also mentioned the issue had gotten worse as more development and skinning progress had been made.

We stripped out Degrafa (we were using Degrafa for skinning). That wasn’t the issue. We changed around some embeds. That wasn’t the issue. Greg eventually narrowed it down to using the Flex Component Kit for skinning as the issue by reverting a sample skin back to the “stateless” way of creating skins. When that was done there was a substantial difference.

The thing is, this issue may not be very noticeable in smaller applications. It’s when you begin to add more controls that the issue becomes very apparent, which may explain why nothing really comes up when you do a Google search.

Patrick Hansen, the UX Designer who created the skins, has written about the issue from a designer perspective and Greg Owen has written a post from a developer’s perspective. They’ve also provided sample files so you can see the issue first hand.

One Response to “Performance Issues Using the Flex Component Kit for Flash”

  1. Ryan Frishberg Says:

    Hey Juan,

    You should take a look at the UIMovieClip code. In it you’ll see there’s an enterFrameHandler. Basically in the Flex world, we have this nice contract of invalidation/validation and notification of when my size changes (you call invalidateSize()). However, in the Flash world, this doesn’t exist, so every frame UIMovieClip is asking: “hey, have you changed size?”.

    I’ll look at how this process can be improved in the future to better optimize these scenarios where you want lots of these flash components. Part of it is that the Flex Component Kit for Flash just wasn’t made for having so many of them at the same time. For now, I’d say you should monkeypatch UIMovieClip.as. Then, modify the file to either set trackSizeChanges to false or to remove the enterFrameHandler all-together.

    Hope that helps,
    Ryan

Leave a Reply