Flex/Flash wmode Performance
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