最近搞一个比较大的Flex分析项目,结果FlashBuilder抗不住了,每次编译都极其慢,然后隔三差五的down掉,于是到处google如何加快速度。
然后发现了:
http://forums.adobe.com/thread/740967
http://bugs.adobe.com/jira/browse/SDK-30367
http://yerii.wordpress.com/2010/12/15/why-has-flex-sdk-4-x-x-become-sluggish-for-some-and-how-you-can-get-it-rolling-again/
正好项目用的是该死的SVN,然后Flex 4 的 OEM编译器还有这个bug,每次编译都去遍历.svn目录。
按照上面yerii博文所述,给出不少解决办法:
- Migrate to different version control system, such as Git – not feasible in our case, generally not cool – 使用其他版本管理系统,比如Git,Mercuial等
- Use only command-line compiler – it’s speed is not affected. But forget auto-build, background error checks… – 使用命令行编译器
- Create mirror directory of your project without the SVN meta data and keep it synchronized – very cumbersome – 通过镜像文件夹分离.svn和源码
- Use the HellFire Compiler – solves the problem, but it means additional license cost and also does not work as smoothly as one would wish – 使用RPC编译器 HellFire Compiler
- File a bug report at Adobe – and wait forever before they even notice – 给Adobe提bug,然后等下去
- Download the Flex SDK source code and repair it by yourself – 下载sdk源码,自己修改。
于是别无选择,只能选择解决办法6。
最讽刺的是Flex3的编译器没有这个bug,而且Adobe还声称提升25%的编译器性能。。。
</div>
<div>
<pre>private void storeTimestamps(File path)
{
// the fix is here:
if(path.isHidden())
return;
// end of the fix
timestamps.put(FileUtil.getCanonicalPath(path), path.lastModified());
for (File file : path.listFiles())
{
if (file.isDirectory())
{
storeTimestamps(file);
}
}
}</pre>
</div>
<div>下载-解压-替换到{flex-sdk-4.x-home}/lib,我换了之后至少flashbuilder不会有事儿没事儿罢工了,至于编译速度,稍快一点点吧,依然很慢!!!(项目太大了)。