| By Yakov Fain | Article Rating: |
|
| November 21, 2006 09:45 AM EST | Reads: |
22,563 |
From Farata Systems Blog
Flex compiler builds an swf file, with a default frame rate of 24 frames per second, unless another value is specified during the compilation. For example,
mxmlc -default-frame-rate=50 HelloWorld.mxml
This command will build the swf file with the frame rate of fifty frames per second. Display list rendering and the ActionScript execution take turns, hence the frame rate can affect your application performance.
Setting the frame rate to fifty does not mean that each frame will be displayed in exactly 20 milliseconds, as there is some OS/browser overhead. Besides, some browsers may impose restrictions on plugins to lower CPU utilization on the user’s machine.
To see how the compile time setting of the default-frame-rate option affects execution of the program let's write a small application that performs a simple calculation of the actual frame rate on each enterFrame event.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal"
enterFrame="enterFrameHandler()">
<mx:Script>
var lastTime:int;
function enterFrameHandler():void {
trace(int(1000/(getTimer()-lastTime)));
lastTime=getTimer();
}
</mx:Script>
<mx:Button label="Button"/>
<mx:TextInput/>
</mx:Application>
I ran this program on a Windows XP laptop with a single 1.8Ghz CPU in the Internet Explorer and FireFox browsers. Tables 1 and 2 show the difference between requested and actual frame rates and how hard the CPU works based on the frame rate settings.
default-frame-rate 10 24 50 100
Actual frame rate 9-10 18-26 35-52 50-110
CPU utilization 15-17% 15-20% 18-20% 26-28%
Table 1 Frame rates with Internet Explorer 6
default-frame-rate 10 24 50 100
Actual frame rate 9-10 16-22 41-50 70-100
CPU utilization 16-20% 18-20% 22-25% 30-33%
Table 2 Frame rates with FireFox 1.5
While results slightly vary, they are self explanatory - lower frame rates translate into lower CPU utilization. You should experiment with the frame rate in your application to find the right balance between the GUI performance and CPU usage.
Remember, your users may be running several programs at the same time, and you do not want to put their CPU on its knees just because you’ve enjoyed the super smooth graphics rendering. If you are not creating a movie, keep the frame rate as low as you can.
Published November 21, 2006 Reads 22,563
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Yakov Fain
Yakov Fain is a Managing Director of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Currently Yakov works on the book for O'Reilly "Enterprise Application Development with Flex". He twits at twitter.com/yfain.
![]() |
CFDJ News Desk 11/21/06 10:03:01 AM EST | |||
This command will build the swf file with the frame rate of fifty frames per second. Display list rendering and the ActionScript execution take turns, hence the frame rate can affect your application performance. Setting the frame rate to fifty does not mean that each frame will be displayed in exactly 20 milliseconds, as there is some OS/browser overhead. Besides, some browsers may impose restrictions on plugins to lower CPU utilization on the user?s machine. |
||||
![]() |
JDJ News Desk 11/21/06 09:02:05 AM EST | |||
This command will build the swf file with the frame rate of fifty frames per second. Display list rendering and the ActionScript execution take turns, hence the frame rate can affect your application performance. Setting the frame rate to fifty does not mean that each frame will be displayed in exactly 20 milliseconds, as there is some OS/browser overhead. Besides, some browsers may impose restrictions on plugins to lower CPU utilization on the user?s machine. |
||||
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Adobe Flex Developer Earns $100K in New York City
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Ph.D. in Twitter Anyone?
- Eolas Sues the Internet
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Special Report on the Emerging Cloud Computing Trend
- Adobe Cans Another 9% of its Workforce
- My Thoughts on Ulitzer
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Ulitzer Live! New Media Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Executives Feature on Cloud Computing Expo Power Panel
- Software Flexibility in the Cloud - Part 4 of 5
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Where Are RIA Technologies Headed in 2008?
- Cover Story: How to Increase the Frame Rates of Your Flash Movies
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Your First Adobe Flex Application with a ColdFusion Backend
- Adobe Flex 2: Advanced DataGrid
- i-Technology Blog: Death-Knell For "Rich Media? Hardly!
- Adobe/Macromedia - Microsoft, Look Out!
- How To Create a Photo Slide Show ...
- Adobe Flex Interface Customization - Themes, Styles, Skins
- Personal Branding Checklist
- Has the Technology Bounceback Begun?
- "Real-World Flex" by Adobe's Christophe Coenraets









































