- 浏览: 72686 次
文章分类
最新评论
-
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 860By adding these two at the star ... -
[Flex3] CSS type selectors are not supported in components XXX
2010-11-30 11:35 1482This warning probably means CSS ... -
[Flex3] can't switch to design view
2010-11-12 11:19 835Issue When switching to design ... -
[Flex] compilation error
2010-10-19 18:35 879If this error occurs: Access o ... -
[Flex] two ways of loading modules
2010-10-14 22:42 876There're two ways of loading an ... -
[Flex4] Could not resolve <mx:X> to a component implementation
2010-10-04 09:27 1217The namespace for halo componen ... -
[Flex] to see trace() info
2010-05-07 13:05 764First of all, must define an mm ... -
[Flex3] An internal compiler error occurred
2009-10-16 14:29 1680If you encounter the "An i ... -
[Flex3] painful ‘Unable to resolve asset for transcoding’ error
2009-09-23 10:33 2127I ran into this error when I wa ... -
[Flex 3] Start multiple AIR instances on a single machine
2009-09-05 20:43 736The AIR runtime does not allow ... -
[Flex3] Unable to resolve resource bundle
2009-08-25 17:55 1405copy and overwrite the default ... -
[Flex] Invalid Embed directive in stylesheet
2009-08-12 14:31 2618Solution found here: http://vic ... -
about rtmp channel
2008-09-30 13:27 1166LCDS provides a RTMP channel wh ... -
[flex] 12个Flex常用功能代码
2008-05-29 14:03 10231. Copy content to clipboard ... -
[flex3] 关于crossdomain.xml
2008-04-17 17:05 3420在jboss4.2中设置crossdomain.xml应该放在 ... -
在WTP Eclipse中配置jotm
2007-12-03 17:32 1344在一般tomcat中配置无用。若不配置,在试图使用Data S ... -
Flex3 change set
2007-11-19 16:04 790http://tools.assembla.com/fle ... -
Useful Flex Builer shortcut list
2007-10-31 13:56 806Ctrl + O : opens the quick outl ... -
Managing with multiple XML namespace in Flex 2 applications
2007-10-31 13:48 990A classic example occurs for ex ... -
Improve performance of Flex Builder 2 IDE
2007-10-31 13:42 897closing all the projects you do ...
相关推荐
【 Quotes From a Friend-crx 插件 】是一款专为英文用户设计的浏览器扩展程序,其核心功能是在用户每次打开新标签页时显示著名激励大师Tony Robbins的励志名言。这款插件旨在通过每日的正能量注入,激发用户的生活...
### get_magic_quotes函数详解 在PHP环境中,处理输入数据的安全性是至关重要的,尤其是在Web开发领域。`get_magic_quotes_gpc()` 和 `get_magic_quotes_runtime()` 函数是PHP早期版本中用于自动转义用户提交的数据...
【Famous Quotes from Famous People - CRX 插件】是一个为英语(英国)用户设计的浏览器扩展程序,其主要功能是展示历史上著名人物的激励性名言。这款插件旨在为用户提供一个简单、便捷的方式,让他们在浏览网络时...
FORALL i IN quotes.FIRST..quotes.LAST UPDATE some_table SET column1 = quotes(i).symbol, column2 = quotes(i).bid WHERE id = quotes(i).id; ``` 在这个例子中,FORALL循环会根据quotes数组中的每一项更新...
股票行情查看 - Stock quotes_v1.0.6.crx
这是一个scrapy官方提供的网站:http://quotes.toscrape.com/ ,网页很简单,麻雀虽小五脏俱全。就用这个网站详细演示下Scrapy基础使用方法。参见博客:https://blog.csdn.net/qq_42776455/article/details/83116164
Programming Quotes
苹果公司的股票数据。
quotes
One of my favorite quotes comes by way of a letter from Sir Isaac Newton, in which he writes, “If I have seen farther, it is by standing on the shoulders of giants.” I too have stood on the ...
Quotes_1499268934132
"tdx market quotes getter" 是一个程序或工具,主要用于获取实时的股票市场报价。TDX,全称为通达信,是中国国内知名的金融数据提供商,提供包括股票、期货、期权等多种金融市场数据服务。这个工具可能是用来比较...
可以使用set_magic_quotes_runtime()函数来控制magic_quotes_runtime的状态,设置为1表示开启,设置为0表示关闭。需要注意的是,magic_quotes_runtime在关闭状态下,从文件或数据库中读取的数据不会被自动转义,可能...
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 ...
开源库“typographic-quotes”正是针对这一需求而设计的,它专注于提供优雅、规范的引号处理方案,确保在网页上始终使用正确的典型大引号。本文将深入探讨这个库的功能、使用方法以及其在实际项目中的应用。 ...
此外,从压缩包文件名称“Smart-Mirror-Magic-Mirror-App-with-weather-and-quotes-for-old-Android-devices-main”来看,其主要内容可能包含了源代码、资源文件以及项目配置等。开发者可以通过分析这些文件来学习...
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 ...
如果`magic_quotes_gpc`设置为开启,但开发者想要手动处理字符串转义,应当首先使用`get_magic_quotes_gpc()`检查当前状态。如果返回值为1,说明数据已经自动转义,这时再使用`addslashes()`就会导致双层转义,因此...
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 ...