AIR 程式效能調校技巧
更新@2009/5/11:
Adobe 有個驅動Garbage Collection的方法:
flash.system.System.gc();
flash.system.System.gc();
但是必須連續呼叫兩次,第一次呼叫: 對物件加上記號;第二次:清除記憶體
更多詳情請見:
http://www.craftymind.com/2008/04/09/kick-starting-the-garbage-collector-in-actionscript-3-with-air/
原文:
http://blogs.adobe.com/air/2009/05/performance_tips_for_adobe_air.html
在處理Grant Skinner發現的CPU效能問題之前,有幾個方法可以先改善AIR程式的效能:
- 盡可能地減少frameRate
- Grant Skinner提供了一個小程式,監聽 AIREvent.APPLICATION_DEACTIVE事件(該事件在AIR的native window失去focus時會觸發; 重新得到focus時,會觸發 APPLICATION_ACTIVE),自動將frameRate降至 1 ,可以看他的文章: http://www.gskinner.com/blog/archives/2009/05/idle_cpu_usage.html
- 盡可能用Timer; 而不是監聽EVENT.ENTER_FRAME做處理
- 用profiler 查看Flex app吧
更多文章:
- http://arno.org/arnotify/2009/05/writing-well-behaved-efficient-air-applications/
- http://www.adobe.com/devnet/air/articles/air_performance.html
- http://blogs.adobe.com/simplicity/2008/11/high_perf_air_apps_max_2008.html
Tags: AIR, performance

June 29th, 2009 at 3:27 am
沒記錯的話”flash.system.System.gc();”
這個好像for 工版使用
對真的release
adobe好像不建議使用這個 or 好像會變成無效
June 29th, 2009 at 3:48 am
官方文件裡提到:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/System.html#gc()
這個方法只能用於AIR 或是 Flash Player Debug version.
可以說說您在哪裡看到官方不建議使用嗎? 謝謝!
June 30th, 2009 at 8:06 pm
我指的應該就是這個
sorry沒有看很清楚
“這個方法只能用於AIR 或是 Flash Player Debug version.”
and有看過一篇討論
我再找出來share
thanks指正^^”