- 浏览: 70765 次
文章分类
最新评论
-
lanliying:
这个问题要什么解决?
[Flex4] Could not resolve <mx:X> to a component implementation -
DavyLee:
简直扯淡,get和load都报同样的错!
[Hibernate] one cause of LazyInitializationException -
SilverRing:
to unzip, use this
tar -zxvf fi ...
[linux] tar and gzip a folder -
SilverRing:
It happens in Tomcat, not JBoss ...
[Log4j] listener order matters -
weifly:
这样写也会有bug:from Ship s where s.n ...
[Hibernate 3] bug about string "call"
1. Architecting Flex Applications That Perform Well
1) Use the Flex navigator containers (Accordion, TabNavigator, and ViewStack). Flex navigator containers help control the creation of child views with deferred instantiation.
2) Dashboard-style. This type of application organizes content into modular, self-contained views. This approach performs well because it organizes complex views, with Flex creating them when the user drills down.
2. Using Layouts, Hierarchy, and Containment Properly
The biggest Flex performance danger is yielding to the temptation to use containers randomly. Principle: Avoid unnecessary container nesting.
1) Avoid Nesting Containers Many Levels Deep
Below are an example of deeply nested code:
Typically, nesting fewer containers provides good results with respect to creation time.
2) Absolute Positioning and Sizing
The calculations to decipher how big each container and its children are, as well as where to place them, can potentially be resource-intensive. Here are two tips that can help reduce these calculations:
i. Hard-code object positions
Absolute positioning does not work well if you want your application to resize when the browser window resizes. Using the Canvas container to create faster layouts should be a last-resort solution.
ii. Hard-code object widths and heights
This technique works with any container or control.
3) Use Grid Containers Wisely
You should only use a Grid container when your controls must line up both horizontally and vertically.
Some common misuses of Grid containers include the following:
a) Using the Grid container when you want to left-justify or right-justify controls in the same container (see Figure 3). Developers often try to do this using the following code:
However, using an HBox container with a Spacer object to fill unwanted space works the exact same way, as shown in the following snippet:
b) Using a Grid container as a child of a Repeater object when alternate mechanisms would work better. Alternatively, you can achieve it with a List control and a custom cell renderer.
3. Examples of Common Container Redundancies to Avoid
1) The VBox container inside an <mx:Panel> tag
A Panel container is a VBox container other Panel styles. For example, instead of writing this:
Use this code instead:
2) VBox container inside an <mx:Application> tag
An Application object is inherently a VBox container layout.
3) Containers as top-level tags for MXML components
You do not need to use a container tag as the top-level tag of your MXML component definition. It is perfectly valid for an MXML component to be a simple control, like:
4) Container wrappers for an MXML component instance
There is no need to wrap a container around an MXML component tag.
can be changed to:
5) Re-evaluate your container choices
4. Using Deferred Instantiation to Improve Perceived Performance
Containers have a creationPolicy property that you set to specify when Flex should create the container (at startup, incrementally, when a user navigates to that container, or based on other user action).
The following list explains what each creationPolicy property does when set on Flex navigator containers:
1) creationPolicy="auto"
on navigator containers: it loads quickly, but users experience a brief pause the first time they navigate from one view to another.
on non-navigator containers: must add extra code to specify when to create the container's children.
2) creationPolicy="all"
When Flex creates the navigator containers, it creates all of the controls in all their child views.
3) creationPolicy="none"
You explicitly instantiate views with the createComponents() method. Flex doesn't instantiate for you.
4) creationPolicy="queued"
Flex creates all containers and then creates the children of the queued containers in the order in which they appear in the application unless you specify a creationIndex property.
Progressive Layout—Queued Creation of Components
Progressive layout is similar to the way HTML applications load content in succession in a client.
More detailed info can be found here.
5. Handling Large Data Sets
Paging and sorting can be incorporated to handle large data sets.
6. Playing Complex Effects Smoothly
to be continued
7. Achieving Great Performance with Runtime Styles
to be continued
8. Improving a Repeater Object's Performance
to be continued
9. Performance Tuning and Profiling Your Own Flex Application
1) Use RSLs
2) Use the actionscript profiler
3) Calculate the intialization time
4) Use getTimer() to time component and data gestures
Check out this blog entry.
Original Artical
1) Use the Flex navigator containers (Accordion, TabNavigator, and ViewStack). Flex navigator containers help control the creation of child views with deferred instantiation.
2) Dashboard-style. This type of application organizes content into modular, self-contained views. This approach performs well because it organizes complex views, with Flex creating them when the user drills down.
2. Using Layouts, Hierarchy, and Containment Properly
The biggest Flex performance danger is yielding to the temptation to use containers randomly. Principle: Avoid unnecessary container nesting.
1) Avoid Nesting Containers Many Levels Deep
Below are an example of deeply nested code:
<mx:VBox> <mx:HBox> <mx:Form> <mx:FormItem> ..... ... </mx:FormItem> </mx:Form> </mx:HBox> </mx:VBox>
Typically, nesting fewer containers provides good results with respect to creation time.
2) Absolute Positioning and Sizing
The calculations to decipher how big each container and its children are, as well as where to place them, can potentially be resource-intensive. Here are two tips that can help reduce these calculations:
i. Hard-code object positions
Absolute positioning does not work well if you want your application to resize when the browser window resizes. Using the Canvas container to create faster layouts should be a last-resort solution.
ii. Hard-code object widths and heights
This technique works with any container or control.
3) Use Grid Containers Wisely
You should only use a Grid container when your controls must line up both horizontally and vertically.
Some common misuses of Grid containers include the following:
a) Using the Grid container when you want to left-justify or right-justify controls in the same container (see Figure 3). Developers often try to do this using the following code:
<mx:Grid borderStyle="solid" width="400"> <mx:GridRow> <mx:GridItem horizontalAlign="left"> <mx:Button label="left" /> </mx:GridItem> <mx:GridItem horizontalAlign="right"> <mx:Button label="right" /> </mx:GridItem> </mx:GridRow> </mx:Grid>
However, using an HBox container with a Spacer object to fill unwanted space works the exact same way, as shown in the following snippet:
<mx:HBox borderStyle="solid" width="400"> <mx:Button label="left" /> <mx:Spacer width="100%" /> <mx:Button label="right" /> </mx:HBox>
b) Using a Grid container as a child of a Repeater object when alternate mechanisms would work better. Alternatively, you can achieve it with a List control and a custom cell renderer.
3. Examples of Common Container Redundancies to Avoid
1) The VBox container inside an <mx:Panel> tag
A Panel container is a VBox container other Panel styles. For example, instead of writing this:
<mx:Panel title="Grocery List" width="150" height="150"> <mx:VBox> <mx:Label text="Fruits" /> <mx:Label text="Veggies" /> <mx:Label text="Cookies" /> </mx:VBox> </mx:Panel>
Use this code instead:
<mx:Panel title="Grocery List" width="150" height="150"> <mx:Label text="Fruits" /> <mx:Label text="Veggies" /> <mx:Label text="Cookies" /> </mx:Panel>
2) VBox container inside an <mx:Application> tag
An Application object is inherently a VBox container layout.
3) Containers as top-level tags for MXML components
You do not need to use a container tag as the top-level tag of your MXML component definition. It is perfectly valid for an MXML component to be a simple control, like:
<mx:Image xmlns:mx=http://www.macromedia.com/2003/mxml source="@embed('foo.jpg')" width="200" height="200" />
4) Container wrappers for an MXML component instance
There is no need to wrap a container around an MXML component tag.
<mx:VBox backgroundColor=" #FFCCCC" borderStyle=" solid"> <myComponent xmlns=" *" /> </mx:VBox>
can be changed to:
<myComponent xmlns=" *" backgroundColor=" #FFCCCC" borderStyle=" solid" />
5) Re-evaluate your container choices
4. Using Deferred Instantiation to Improve Perceived Performance
Containers have a creationPolicy property that you set to specify when Flex should create the container (at startup, incrementally, when a user navigates to that container, or based on other user action).
The following list explains what each creationPolicy property does when set on Flex navigator containers:
1) creationPolicy="auto"
on navigator containers: it loads quickly, but users experience a brief pause the first time they navigate from one view to another.
on non-navigator containers: must add extra code to specify when to create the container's children.
2) creationPolicy="all"
When Flex creates the navigator containers, it creates all of the controls in all their child views.
3) creationPolicy="none"
You explicitly instantiate views with the createComponents() method. Flex doesn't instantiate for you.
4) creationPolicy="queued"
Flex creates all containers and then creates the children of the queued containers in the order in which they appear in the application unless you specify a creationIndex property.
Progressive Layout—Queued Creation of Components
Progressive layout is similar to the way HTML applications load content in succession in a client.
More detailed info can be found here.
5. Handling Large Data Sets
Paging and sorting can be incorporated to handle large data sets.
6. Playing Complex Effects Smoothly
to be continued
7. Achieving Great Performance with Runtime Styles
to be continued
8. Improving a Repeater Object's Performance
to be continued
9. Performance Tuning and Profiling Your Own Flex Application
1) Use RSLs
2) Use the actionscript profiler
3) Calculate the intialization time
<?xml version="1.0" encoding="iso-8859-1"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" creationComplete="doLater(this,'doneNow')"> <mx:Script><![CDATA[ var dp = [{food:"apple", type:"fruit", color:"red"}, {food:"potato", type:"vegetable", color:"brown"}, {food:"pear", type:"fruit", color:"green"}, {food:"orange", type:"fruit", color:"orange"},{food:"spinach", type:"vegetable", color:"green"},{food:"beet", type:"vegetable", color:"red"}]; function doneNow() { doLater(this, "reallyDoneNow"); } function reallyDoneNow() { timerLabel.text += getTimer() + " ms" } ]]></mx:Script> <mx:Form> <mx:FormHeading label="Sample Form" /> <mx:FormItem label="List Control"> <mx:List dataProvider="{dp}" labelField="food"/> </mx:FormItem> <mx:FormItem label="DataGrid control"> <mx:DataGrid width="200" dataProvider="{dp}"/> </mx:FormItem> <mx:FormItem label="Date controls"> <mx:DateChooser /> <mx:DateField /> </mx:FormItem> <mx:FormItem label="Load Time"> <mx:Label id="timerLabel" fontSize="12" fontWeight="bold" text="The application initialized in "/> </mx:FormItem> </mx:Form> </mx:Application>
4) Use getTimer() to time component and data gestures
Check out this blog entry.
Original Artical
发表评论
-
[Flex] to display unrecognizable characters correctly of trace()
2011-03-04 17:06 814By adding these two at the star ... -
[Flex3] CSS type selectors are not supported in components XXX
2010-11-30 11:35 1453This warning probably means CSS ... -
[Flex3] can't switch to design view
2010-11-12 11:19 804Issue When switching to design ... -
[Flex] compilation error
2010-10-19 18:35 841If this error occurs: Access o ... -
[Flex] two ways of loading modules
2010-10-14 22:42 842There're two ways of loading an ... -
[Flex4] Could not resolve <mx:X> to a component implementation
2010-10-04 09:27 1174The namespace for halo componen ... -
[Flex] to see trace() info
2010-05-07 13:05 732First of all, must define an mm ... -
[Flex3] An internal compiler error occurred
2009-10-16 14:29 1641If you encounter the "An i ... -
[Flex3] painful ‘Unable to resolve asset for transcoding’ error
2009-09-23 10:33 2086I ran into this error when I wa ... -
[Flex 3] Start multiple AIR instances on a single machine
2009-09-05 20:43 700The AIR runtime does not allow ... -
[Flex3] Unable to resolve resource bundle
2009-08-25 17:55 1353copy and overwrite the default ... -
[Flex] Invalid Embed directive in stylesheet
2009-08-12 14:31 2574Solution found here: http://vic ... -
about rtmp channel
2008-09-30 13:27 1125LCDS provides a RTMP channel wh ... -
[flex] 12个Flex常用功能代码
2008-05-29 14:03 9781. Copy content to clipboard ... -
[flex3] 关于crossdomain.xml
2008-04-17 17:05 3387在jboss4.2中设置crossdomain.xml应该放在 ... -
在WTP Eclipse中配置jotm
2007-12-03 17:32 1295在一般tomcat中配置无用。若不配置,在试图使用Data S ... -
Flex3 change set
2007-11-19 16:04 752http://tools.assembla.com/fle ... -
Useful Flex Builer shortcut list
2007-10-31 13:56 765Ctrl + O : opens the quick outl ... -
Managing with multiple XML namespace in Flex 2 applications
2007-10-31 13:48 940A classic example occurs for ex ... -
Improve performance of Flex Builder 2 IDE
2007-10-31 13:42 863closing all the projects you do ...
相关推荐
get_magic_quget_magic_quotes函数详解oget_magic_quotes函数详解get_magic_quoget_magic_quotes函数详解get_magic_quotes函数详解get_magic_quotes函数详解get_magic_quotes函数详解tes函数详解get_magic_quotes...
股票行情查看 - Stock quotes_v1.0.6.crx
Programming Quotes
苹果公司的股票数据。
这是一个scrapy官方提供的网站:http://quotes.toscrape.com/ ,网页很简单,麻雀虽小五脏俱全。就用这个网站详细演示下Scrapy基础使用方法。参见博客:https://blog.csdn.net/qq_42776455/article/details/83116164
quotes
Quotes_1499268934132
Quotes_1499696271593
语言:English (United States)每次您打开一个新标签时,请阅读Tony Robbins的强有力的报价。每次您打开一个新标签时,请阅读Tony Robbins的强有力的报价。
Ajax, the popular term for Asynchronous ... The book even addresses best practices for testing Ajax applications and improving maintenance, performance, and reliability for JavaScript code.
Ren′e Descartes, and it is one of the most famous quotes in the world: do a web search for it, and you will be flooded with hits. Deducing your existence from the fact that you’re thinking about ...
tdx market quotes caller, test which quote is faster
语言:English (UK) 显示历史上名人的名言 它显示了名人的励志名言。
get_magic_quotes_gpc函数介绍 取得 PHP 环境变数 magic_quotes_gpc 的值,属于 PHP 系统功能。 语法: long get_magic_quotes_gpc(void); 返回值: 长整数 本函数取得 PHP 环境配置的变量 magic_quotes_gpc (GPC, Get...
editing the displaying of hint for flex-object within the object. - ADD: Added the protected-property TFlexPanel.GridControl - a flex-object for drawing grid on document. - FIX: The method ...
Using the Auto Refresh function in the SQL Window would prompt for substitution variable values for each refresh March 1, 2019 - Version 13.0.2 released Enhancements Performance and stability ...
从@QuotesFromDal twitter页面随机引用 由于Dal在一周中的每一天都不可以每天24小时与您在一起(祝贺1k的追随者Dal),因此他的精髓已被捕获在一个小部件中,以供您欣赏! 当您在Chrome浏览器中安装此扩展程序时,您...
本篇文章小编为大家介绍,基于magic_quotes_gpc与magic_quotes_runtime的区别与使用介绍。需要的朋友参考下
用于开源项目的Programming Quotes API。 主页: Github: API文档 支持的语言:en,sr。 公共路线 GET (获取所有报价) GET (按语言获取报价) GET (按页获取报价) GET (获得随机报价) GET (按语言...
Quotes loader every day