I run Flex Builder 3 on a mac and as my project grows - the compile time gets longer and longer and longer. I am using some SWC's and there is a fair amount of code but it shouldn't take minutes to build and crash daily should it?
我在Mac上运行Flex Builder 3,随着项目的增长 - 编译时间越来越长。我正在使用一些SWC并且有相当数量的代码但是它应该不需要花费几分钟来构建并且每天都会崩溃吗?
5
In addition to the suggestions already mentioned, close any projects that you have open that you are not using.
除了已经提到的建议之外,请关闭您未打开的任何项目。
Rich click on the Project in the Navigator view and select "Close Unrelated Projects".
在Navigator视图中单击Project,然后选择“Close Unrelated Projects”。
Depending on how many projects you have open, this can lead to a significant improvements in compile time, as well as all around performance.
根据您打开的项目数量,这可以显着改善编译时间以及所有性能。
mike chambers
mesh@adobe.com
10
First of all, comments on some of the response:
首先,对一些回复的评论:
There is no need to explicitly specify -incremental in Flex Builder because it uses incremental compilation by default.
无需在Flex Builder中明确指定-incremental,因为它默认使用增量编译。
-keep-generated-actionscript is a performance killer because it instructs the compiler to write out AS3 codes generated for MXML components in the middle of the compilation. File I/O in the middle of a compilation means unnecessary pauses and low CPU utilizations.
-keep-generated-actionscript是一种性能杀手,因为它指示编译器在编译过程中写出为MXML组件生成的AS3代码。编译过程中的文件I / O意味着不必要的暂停和低CPU利用率。
-optimize slows down linking because it instructs the linker to produce smaller SWFs. Note that -optimize=true|false doesn't have any effect on building SWCs because SWCs are libraries and have to be unoptimized.
-optimize减慢链接速度,因为它指示链接器生成较小的SWF。请注意,-optimize = true | false对构建SWC没有任何影响,因为SWC是库,必须不优化。
I rarely mess with JVM settings because JVM knows its jobs well and tunes itself quite well at runtime. Most people make matter worse by setting various GC tuning parameters. That said, there are 3 settings most people understand and set correctly for their usage:
我很少搞乱JVM设置,因为JVM很好地了解它的工作并且在运行时很好地调整自己。大多数人通过设置各种GC调整参数使事情变得更糟。也就是说,大多数人都了解并正确设置了3种设置:
-Xmx (max heap size)
-Xmx(最大堆大小)
-server or -client (HotSpot Server or Client VM)
-server或-client(HotSpot服务器或客户端VM)
-XX:+UseSerialGC or -XX:+UseParallelGC (or other non-serial GC)
-XX:+ UseSerialGC或-XX:+ UseParallelGC(或其他非串行GC)
-server consistently outperforms -client by about 30% when running the Flex compiler. -XX:+UseParallelGC turns on the parallel garbage collector. ideal for multicore computer and when the computer still has CPU cycles to spare.
运行Flex编译器时,-server始终优于-client约30%。 -XX:+ UseParallelGC打开并行垃圾收集器。适用于多核计算机,当计算机仍有CPU周期时。
You may also want to check out HellFire Compiler Daemon (http://bytecode-workshop.com/). It uses multiple processor cores to compile multiple Flex applications at the same time. You can also run the compiler on a second machine via sockets (assuming that your second machine has faster CPUs and more memory).
您可能还想查看HellFire Compiler Daemon(http://bytecode-workshop.com/)。它使用多个处理器内核同时编译多个Flex应用程序。您还可以通过套接字在第二台计算机上运行编译器(假设您的第二台计算机具有更快的CPU和更多内存)。
In my opinion, use more modules than libraries and use HFCD.
在我看来,使用比库更多的模块并使用HFCD。
Hope this helps.
希望这可以帮助。
-Clement
9
There's no need to use mxmlc
on the command line just to be able to add compiler flags. Right click your project in the Flex Navigator, select Properties and then Flex Compiler in the dialog that appears. There you can add any extra compiler flags.
为了能够添加编译器标志,不需要在命令行上使用mxmlc。在Flex Navigator中右键单击您的项目,在出现的对话框中选择Properties,然后选择Flex Compiler。你可以添加任何额外的编译器标志。
Not sure that there's very much to do though, more code means more compile time, that's just the way it is. If you're not doing a release build (or whatever it's called in Flex Builder) it's unlikely that your compiler settings include optimize
to begin with. Better choices to try would be -incremental
(which only recompiles the parts that have changed) and -keep-generated-actionscript
(which stops the compiler from deleting the ActionScript files it has generated from your application's MXML files).
不确定是否有很多工作要做,更多的代码意味着更多的编译时间,这就是它的方式。如果您没有进行发布构建(或者在Flex Builder中调用它),那么您的编译器设置不太可能包括优化。更好的选择是-incremental(只重新编译已更改的部分)和-keep-generated-actionscript(它阻止编译器删除它从应用程序的MXML文件生成的ActionScript文件)。
I very much prefer using mxmlc
on the command line (by way of Ant) compared to Flex Builder. Although I don't think that the latter compiles any slower, it feels more sluggish in every way. Using Ant also makes it possible to do more than just compilation when building, and conditional compilation (only compile a SWF or SWC if the source code has actually changed). Check out a blog post of mine for more info on that.
与Flex Builder相比,我更喜欢在命令行上使用mxmlc(通过Ant)。虽然我不认为后者编程速度较慢,但在各方面都感觉更加迟钝。使用Ant还可以在构建和条件编译时完成编译(如果源代码实际已更改,则只编译SWF或SWC)。查看我的博客文章了解更多相关信息。
What you could try is the Flex Compiler Shell, another command line tool that can speed things up. Basically it tries to keep as much as possible in memory between builds, so no need to wait for things like the JVM starting up (the Flex compiler is a Java application). On the other hand this is sort of what Flex Builder does anyway.
您可以尝试的是Flex Compiler Shell,这是另一个可以加快速度的命令行工具。基本上它试图在构建之间尽可能多地保留在内存中,因此不需要等待JVM启动这样的事情(Flex编译器是Java应用程序)。另一方面,这就是Flex Builder所做的一切。
4
Slow compile time is most often caused by having large numbers of embedded resources ([Embed] or @Embed).
编译时间慢通常是由于拥有大量嵌入资源([Embed]或@Embed)造成的。
Option 2 on this article might help you: [http://www.rogue-development.com/blog2/2007/11/slow-flex-builder-compile-and-refresh-solution-modules/]
本文的选项2可能对您有所帮助:[http://www.rogue-development.com/blog2/2007/11/slow-flex-builder-compile-and-refresh-solution-modules/]
4
I created RAM Disk with workspace and it gives up to 10% of better compilation time. Not much, but something.
我创建了带工作空间的RAM磁盘,它可以提供高达10%的更好的编译时间。不多,但有些东西。
2
You want at least 4 gigs on your computer if possible, and make sure to override the default memory settings that eclipse/flexbuilder gives to the application.
如果可能,您希望计算机上至少有4场演出,并确保覆盖eclipse / flexbuilder为应用程序提供的默认内存设置。
If you're not sure how to do this, you can find the flexbuilder app in /Applications, right click and choose "Show Package Contents". Then go into the contents file and edit the eclipse.ini file. Edit that file have memory settings of at least:
如果您不确定如何执行此操作,可以在/ Applications中找到flexbuilder应用程序,右键单击并选择“显示包内容”。然后进入内容文件并编辑eclipse.ini文件。编辑该文件的内存设置至少为:
-vmargs -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=128m
It's also worthwhile to go into the eclipse/flexbuilder preferences and to check the "Show heap status" box under Windows->Preferences->General (This is in eclipse with the FB plugin, I'm assuming it's also there for standalone FB).
进入eclipse / flexbuilder首选项并检查Windows-> Preferences-> General下的“显示堆状态”框也是值得的(这是在使用FB插件的eclipse中,我假设它也适用于独立的FB) 。
This shows the current memory in the lower right of the window and has a little trash icon so you can force garbage collection.
这显示了窗口右下角的当前内存,并且有一个垃圾桶图标,因此您可以强制进行垃圾回收。
I'd also suggest turning off automatic building of the project when your files change (you can force a build with cmd-B).
我还建议在文件更改时关闭项目的自动构建(您可以使用cmd-B强制构建)。
We had a huge project with quite a few modules files and performance in FlexBuilder 3 was decent with these steps.
我们有一个包含相当多模块文件的庞大项目,FlexBuilder 3中的性能与这些步骤相当不错。
1
Go to Project->Properties->Flex Applications. All of the applications listed are compiled each time (even though you have a default set). If you remove everything but the default (don't worry, it won't delete the actual files), it only compiles the default app. This resulted in a significant speed up for me. If you change your default app, it ADDs it to the Flex Applications list - adding to your compile time. You will need to maintain this list to get the quickest compile.
转到项目 - >属性 - > Flex应用程序。每次列出的所有应用程序都会被编译(即使您有默认设置)。如果删除除默认值之外的所有内容(不用担心,它不会删除实际文件),它只会编译默认应用程序。这导致了我的显着加速。如果更改默认应用程序,则会将其添加到Flex应用程序列表 - 添加到编译时。您需要维护此列表以获得最快的编译。
1
I always disable "automatic compile" for Flex. It compiles too much, takes too long, and so interrupts my work.
我总是禁用Flex的“自动编译”。它汇编太多,耗时太长,因此打断了我的工作。
If you have many different project files and all of those needs to be recompiled, but you also have other projects open and don't want to close them always you're doing a build, you can also use Eclipse Working Sets.
如果您有许多不同的项目文件,并且所有这些都需要重新编译,但是您还打开了其他项目并且不想关闭它们,那么您也可以使用Eclipse工作集。
Unfortunately, the default Flex Navigator does not support working sets. But you can open the Package Explorer with Window / Show View / .... Click on the little white downward arrow to the topright and select Top Level Elements: Working Sets. You can then add Working Sets (aka groups of projects). Each project needs to be in at least one working set ("Other Projects" being the default), but can be in several.
不幸的是,默认的Flex Navigator不支持工作集。但是您可以使用Window / Show View /打开Package Explorer。点击顶部的小白色向下箭头,然后选择顶级元素:工作集。然后,您可以添加工作集(也称为项目组)。每个项目都需要至少有一个工作集(默认为“其他项目”),但可以有几个。
Now with Project / Build Working Set / ... you can instruct Eclipse to build all the projects in this working set, but none of the others. This is especially useful if you suspect your project references to be sometimes broken - otherwise building the 'topmost' project should trigger subsequent builds automatically.
现在有了Project / Build Working Set / ...你可以指示Eclipse在这个工作集中构建所有项目,但没有其他项目。如果您怀疑项目引用有时会被破坏,这将非常有用 - 否则构建“最顶层”项目应该会自动触发后续构建。
1
As Clement said, use the HellFire Compiler Daemon. If you have multiple modules and more CPU cores on your machine it can compile them in parallel. Another option is to use IntelliJ (the commercial version) which offers the same feature.
正如Clement所说,使用HellFire编译器守护进程。如果您的计算机上有多个模块和更多CPU核心,它可以并行编译它们。另一种选择是使用提供相同功能的IntelliJ(商业版)。
1
The SDK 4.x.x introduced silly bug (see Adobe bugsystem, issue FB-27440), which causes projects with SVN or CVS meta data compile much slower than with SDK 3.x.x. On how it can be fixed, see here.
SDK 4.x.x引入了愚蠢的bug(参见Adobe bugsystem,问题FB-27440),这导致使用SVN或CVS元数据编译的项目比使用SDK 3.x.x慢得多。关于它是如何修复的,请看这里。
0
You may want to explore the command-line compiler found in the Flex SDK, mxmlc
. As I recall, Flex Builder 3 seems to hide all the compiler details, but perhaps there are arguments you can append that will help you speed up the compilation.
您可能希望探索Flex SDK中的命令行编译器mxmlc。我记得,Flex Builder 3似乎隐藏了所有编译器的细节,但也许你可以附加的参数可以帮助你加速编译。
For example, you may want to set optimize=false
which will skip the step of optimizing the bytecode (perhaps reducing compilation time)? This of course comes at the price of performance and file size of the actual application.
例如,您可能想设置optimize = false,这将跳过优化字节码的步骤(可能减少编译时间)?这当然是以实际应用程序的性能和文件大小为代价的。
More documentation on mxmlc
can be found at: http://livedocs.adobe.com/flex/3/html/compilers_13.html.
有关mxmlc的更多文档,请访问:http://livedocs.adobe.com/flex/3/html/compilers_13.html。
Good luck!
0
I don't use Flex Builder, but I use the Flex SDK compiler everyday and I was wasting tons of time waiting for the MXMLC compiler to do its job until I found Flex Compiler SHell:
我不使用Flex Builder,但是我每天都使用Flex SDK编译器,在找到Flex Compiler SHell之前,我浪费了大量时间等待MXMLC编译器完成其工作:
http://blog.zarate.tv/2008/12/07/theres-something-called-flex-compiler-shell/
Although in theory Flex Builder already uses this optimizations, might be worth checking.
虽然理论上Flex Builder已经使用了这种优化,但值得检查。
0
You can use WORKING SETS to compile just a set of your components that are part of the application that you are changing and not the whole project
您可以使用WORKING SETS编译一组组件,这些组件是您要更改的应用程序的一部分,而不是整个项目
http://livedocs.adobe.com/flex/3/html/help.html?cOntent=build_6.html
-1
Usually the first build takes the longest, and then it's pretty quick after that. That's using Vista x64 w/ core 2 duo.
通常第一次构建时间最长,之后很快就会很快。那是使用Vista x64 w / core 2 duo。
Otherwise, I am nearly certain a Intel Core i7 Extreme Edition 965 3.2GHz upgrade processor would speed your Flex building up nicely .. :) :) :)
否则,我几乎肯定英特尔酷睿i7至尊版965 3.2GHz升级处理器会加速你的Flex建立得很好.. :) :) :)