Flex/Flash wmode Performance

Posted on June 14, 2006 | 2 comments

I have been working with a component that loads FLV video and SWF animations. The component is sometimes CPU intensive because of the FLV video and SWF animations used. The custom media controller is created in both Flex and Flash (MTASC and Eclipse).

The flash version was used in many more custom integration situations. One such case was a floating iframe/div over a existing web site. We started testing the CPU usage using Windows Performance Monitor tool. Data was logged and charted for the specific SWF playing browser’s process CPU usage. The charts showed a significant difference on the lower threshold of the CPU usage between the Flash and Flex versions. All the test where down on the same computer with the same settings.

The Flex version was running about 10%-15% at the lower threshold compared to 35%-40% that Flash was running at. After many attempts to distinguish the differences between the Flash and Flex code we came to a simple matter of HTML and wmode.

Before this time I was not aware of the little details of wmode. I knew of the three options Window, Opaque, and Transparent. I did not know of the ramifications and many effects of the different modes. An article found here is a good resource for explain the modes and common issues related to their usage.

I basically confirmed that using wmode=”transparent” cause quite a big performance gap. Of course our tests of 20%-30% different are done on a slower machine (1Ghz). Therefore the performance hit will not be as noticeable on faster machines.

The good news from all this was the Flash and Flex code differences was not an issue in our tests

  • http://arulprasad.blogspot.com Arul Prasad

    Hey,

    Check this out as well. Tinic Uro gives some insight about the performance related issues when playing FLVs and turning on wmode.

    http://www.kaourantin.net/2005/01/wmode-and-flash-video.html

    ~Arul Prasad.

  • http://www.renaun.com Renaun Erickson

    Thanks for the input, we spent a long time tearing apart our Flash version of our component before we found the WMODE issue. Sure did learn alot about other minor performance issues (anmiations in the background, more to draw more for the CPU to handle, etc..).