关于flex性能调优相关的一些总结
来源:互联网 发布:显示器色彩校正软件 编辑:程序博客网 时间:2024/05/16 01:54
1.Performace包含4点:
(1)Latency反应时间(2)Scalability:可伸缩性(3)Reliablity:稳定性(4)Availability:可用性
2.运行时生命周期:
Flex只有两帧frames:Preload frame 和 application frame。
每一个flex application 是一个MovieClip,因为每个flex application都有SystemManager,他是继承自
flash.display.MovieClip.
Flex application的入口是Application layout的容器,他是继承自UIComponent。
UIComponent->Container->LayoutContainer->Application->WindowedApplication
3.典型的生命周期事件:
add: 组件被添加到容器上(addChild, addChildAt)时发出
preinitialize: 预初始化时发出
initialize: 完成构造,所有属性都被设置完成后发出
creationComplete: 完成构造,属性,测量,布局,绘制后发出
applicationComplete: Dispatched after the Application has been initialized, processed by the LayoutManager,
and attached to the display list.
0:Application 1:inner Container 2:component
preinitializeHandler0 called!
childAddHandler0 called!
preinitializeHandler1 called!
initializeHandler1 called!
childAddHandler1 called!
preinitializeHandler2 called!
initializeHandler2 called!
initializeHandler0 called!
creationCompleteHandler2 called!
updateCompleteHandler2 called!
creationCompleteHandler1 called!
updateCompleteHandler1 called!
creationCompleteHandler0 called!
updateCompleteHandler0 called!
4.创建策略:
每个容器都有如下的创建策略:
all:创建所有的组件
auto:按照默认策略
none:不创建,直到调用createComponentFromDescriptors方法被调用
queued:首先创建所有的容器,然后把孩子依次创建,creationIndex决定初始化顺序,小者优先。
5.检测启动的时间
var recordedTime:Number = getTimer();
6.延迟和顺序创建组件
7.在flex Application中包含另外一个Application
<mx:SWFLoader source="FlexApp2.swf" />
我们经常要把一个swf包含进来,并且调用它的方法。当一个swf被包含进来后,就可以了。SWFLoader有以下几个事件
complete,init,progress,unload。
(1)各自隔离 var loaderContext:LoaderContext;
loaderContext.applicationDomain = new ApplicationDomain();
(2)子域var loaderContext:LoaderContext;
loaderContext.applicationDomain =new ApplicationDomain(ApplicationDomain.currentDomain);
(3)同一个域 var loaderContext:LoaderContext;
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
8.RSL(Run-time Shared Libraries)
RSL是在Application之外的一个库,这个库只下载一次,可以被多个Application公用。
好处:(1)Application的size变小了(2)只下载一次节约时间
RSL有两种link方式(1)staic linking所有的类都被打到同一个包中,这样快,但是swf会很大。(2)dynamic linking,额
外的类被打到一格swf中,在运行时链接。
RSL分为3类:(1)Standard RSL同一个domain中多个Applications公用(2)Cross-domain RSL跨域公用(3)Framework RSLs
:Flex框架本身的rsl。
standard rsl和cross-domain rsl存在于浏览器的缓存中,而framework rsl存在于flashplayer的缓存中。
9.更好的应用设计
10.高效的使用容器。
每一个新的容器都包含计算位置,大小和样式。动态计算则需要更多的工作量。
11.使用绑定还是事件?
12.Array还是ArrayCollection
13.利用延迟加载
14.内存使用,抗压性,可用性
flash.system.System.totalMemory
Doing the following is beneficial:
Stop other heavy processes on your machine.
Avoid using debug on the Flash Player.
Switch the trace and logging options off.
Switch any hardware or operating system–level factors that affect memory allocation to the
Flash Player.
- 关于flex性能调优相关的一些总结
- 关于FLex性能的测试总结
- 【转载】Flex垃圾回收和性能优化的一些总结
- 关于JavaScript性能的一些总结
- 一些关于性能优化的总结
- [Flex]Flex编程注意之性能优化、垃圾回收的一些总结
- Flex]Flex编程注意之性能优化、垃圾回收的一些总结
- Asp.net性能优化总结[关于数据处理相关的优化]
- Asp.net性能优化总结[关于数据处理相关的优化]
- 关于有效的性能调优的一些建议
- 项目q总结:关于Linux性能问题的一些思考
- 关于程序性能优化基础的一些个人总结
- 关于程序性能优化基础的一些个人总结
- 关于boost库性能与安全的一些总结
- flex开发环境的一些相关配置
- Flex编程注意之性能优化、垃圾回收的一些总结
- Flex编程注意之性能优化、垃圾回收的一些总结
- 关于Java虚拟机性能调优方法的一些分析
- struts2 文件上传
- js 表单验证,网上搜的 作者忘了··不要怪我
- 0欧电阻的用途
- framebuffer一个问题的解决
- C#获取项目程序及运行路径的方法
- 关于flex性能调优相关的一些总结
- 步进电机经验谈
- Axis2 WS-Security 签名和加密
- 如何选择单片机
- java file io
- 【转】C#中静态和非静态的区别
- 在VC++应用程序中彻底清除进程
- String引用类型
- Page.ClientScript属性