Since Flash CS3, two new modes have shown up in the ActionScript Settings.
You can reach this panel from :
File -> Publish Settings -> Flash Tab -> Script > Settings.
The "Warnings Mode" will give you some hints when compiling mainly for migration, like saying that the createEmptyMovieClip method is replaced by the new instanciation model introduced in ActionScript 3.
This mode will also give you some hints like saying that the firstName variable will be converted to boolean at runtime in the following code :
var firstName:Boolean = "Bob";
When coding for the first time in ActionScript 3, this mode is very nice but it takes a lot of processing during compile time to handle all those warnings. This results in a high reduction of compilation time if you keep this mode enabled. By disabling it, I switched on my computer from 34 seconds to 10 seconds to compile a big project, which is just great.
So if you are compiling in Flash CS3 or CS4 and coding in FDT or Eclipse where you may already have a lot of warning errors being tracked when typing, especially with the fantastic as3v from the crazy Joa, you may not need this mode anyway, so just disable it to boost compilation time.
Thanks to the Flash team engineers for telling me about this trick
Comments (14)
Hé bien, voila qui va peut-être me permettre de gagner de précieuses secondes de compilation
Merci pour l’astuce
Never used ‘strict mode’. I came across similar problem when writing as3 classes with library assets. The stage objects reference like ‘this.myButton’ throwed errors while in ‘strict’
Wooooooow!!! amazing, it really saves a lot of time, i’m working on a project that originally takes 36 secs to compile, but with the magic of this trick it only takes 8 seconds!
Thanks!
Hello there,
Thank you for this tip! I ‘translate’ your post by my words in my blog.
I did test in my mac and almost reduces 50% of my compile time in big projects O_O. Very nice practice.
Cheers
Thanks for this. Very usefull!
Wow, went from 24 seconds to only 6! My timesheets thank you.
That’s a really great tip – thank you!
I use the Adobe Flex SDK in Linux with fcsh. Compilations are in strict mode and I can compile huge projects under a few seconds.
How many seconds it take you to fix a bug that a warning or strict mode would have caught?
I just want to confirm it works, massively! It seems the more code / API you include in your project, the slower it can become with this option switched on.
On average for me a standard game project will take around 12-15 secs to compile, but with a large game project it takes a massive 55 secs with each new API / class adding about 2-10 secs a piece.
With this option off (turning off strict mode can help as well) I get back my 12-15 secs compile time which is sweet because waiting a minute every time to test the smallest (or largest) of changes is pretty unacceptable for me.
Hi Richard,
This optimization trick only requires to disable warning mode, not the strict mode which is really useful and definitely should stay on. The warning mode only catches migration issues and other minor code warning.
Hi Leroy,
Cool to hear !
best,
Thibault
Warning mode has saved me during logical operations, sometimes writing = instead of ==.
The warning asks if you mean ==.
Otherwise this can be a hard bug to track down because its outcome is completely unrelated to what the intention was.
Hi Meister,
Yes, that’s true. There are some cases where the warning mode can be really useful. But it’s tempting to disable it, when you see the compilation time boost you can have when disabling it.
Btw, to avoid doing this error you can also write your conditions like this :
if ( 10 == score )
Instead of the classical :
if ( score == 10 )
This way, you’ll get compiler error if you use simple equality operator like this :
if ( 10 = score )
best,
Thibault
I finally stopped compiling in Flash altogether and have switched to compiling in FlashDevelop and using code injection. The first time I got a project to compile I just assumed it wasn’t working at all. Compile times reduced from 30+ seconds to about 1-2 seconds. Now I need to check out this Warnings mode setting.
Trackback/Pingback (1)
[...] Imbert over at http://bytearray.org beleavs that you can speed up your compile time by disabling the Warnings mode in your File -> [...]