惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
Help Net Security
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
Arctic Wolf
Cyberwarzone
Cyberwarzone
The Hacker News
The Hacker News
P
Privacy & Cybersecurity Law Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 最新话题
Hacker News: Ask HN
Hacker News: Ask HN
The Last Watchdog
The Last Watchdog
Forbes - Security
Forbes - Security
SecWiki News
SecWiki News
H
Heimdal Security Blog
Latest news
Latest news
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Help Net Security
AWS News Blog
AWS News Blog
Cloudbric
Cloudbric
W
WeLiveSecurity
I
InfoQ
B
Blog RSS Feed
Webroot Blog
Webroot Blog
博客园 - 三生石上(FineUI控件)
T
Tor Project blog
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
GbyAI
GbyAI
S
Security Affairs
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
MongoDB | Blog
MongoDB | Blog
T
Threatpost
罗磊的独立博客
L
LINUX DO - 热门话题
C
CXSECURITY Database RSS Feed - CXSecurity.com
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - GIS小能

利用Simplify进行ArcGIS Server多面合并查询 关于Flex Ant的相关注意事项 ArcGIS KeyGen注册机,五步操作实现ArcGIS9.X与ArcGIS10全模块无时限破解(转载:我是一只牛) Flex开发必知(1) ArcGIS Server 10 问题汇总 ArcGIS Server 10 许可文件 Ecp 基于flex及SVG技术打造交互式地图(数据篇) 将应用程序从Flex 3迁移至Flex 4(转载) ArcGIS 10 破解安装(desktop及ArcGIS Server 10) 基于Geoserver配置多图层地图以及利用uDig来进行样式配置 基于ArcGIS Server 10 在flex瓦片客户端叠加瓦片服务 胡说八道--mate flex与flash交互详解 flex调用WMS远程图片所产生安全错误 loder导致的安全沙箱的2122错误 flex一周精选(20100308) 解析MapBar兴趣点加载原理 Flex一周精选(20100301) 浅谈Image和Bitmap
flex 优化原则
GIS小能 · 2010-10-11 · via 博客园 - GIS小能

  在flex cook上看到这些优化原则,觉得还是不错,先贴在博客上,免得不好找!

a)         如果不知道一个对象的类型,使用as操作符而不是使用try...catch,后者更慢一些:

var iface:IMyInterface = (obj as IMyInterface);

b)         稀疏数组访问起来比较慢,所以把空的项填上null会提高速度。从数组中找不到一个值

的操作非常慢,比找到一个值要慢20倍。

c)         当加整数时,Flash Player会把整数转化成数字,加完后再转换回来。因此当执行数学计算时,应当尽量使用数字,只是在最后再转换成整数。

d)         局部变量的访问速度比较快,因此频繁访问的变量尽量设置成局部变量。它们会被存储

在栈上,访问起来非常快。

e)         如果可能,在创建显示组件时尽量使用延迟的实例化以避免让用户等待。

f)          数据绑定会耗费内存并减慢程序启动时间。如果不需要绑定,比如一个值只会更新一两

次,那么最好直接设置它的值。

g)         不用使用容器类作为ListDataGirditemRenderer;而应该使用UIComponent

h)         如果你使用组件或对象监听了某个事件,并希望以后被垃圾回收,记得要使用removeEventListener移除事件监听。

i)           对于色彩丰富的UIConponent或者包含位图数据的对象使用cacheAsBitmap。这样FlashPlayer就能重复使用创建的位图来显示,直到需要重绘。注意,想要改变缓存的位图非常困难,并且在缩放时可能会失真。

j)           运行期调用setStyle代价很大,所以要减少类似的操作。但是在DisplayObject对象添加到显示列表之前调用setStyle的的开支会小一些。