
Last week, while visiting our Newton/Boston office, I had the chance to spend a few minutes chatting with a few of my old good JRun 4 buddies, now lead engineers under the Flex compiler and Flash VM teams.
These folks are purely brilliant and it’s a privilege for me to have direct access to them (no wonder why I am no longer in R&D… just too hard to keep up
).
One of these conversations (with Paul Reilly) centered around what the sdk/compiler team is doing to make Flex applications to compile faster.
Before talking about some numbers, let’s start by noting the two different schemes used to compile. The first is called “active incremental compilation”, which represents an in-memory compilation (this technique is what Flex Builder uses most of the time), while the second one, called “inactive incremental”, uses a cache on disk (used by the command line compile tool).
In both scenarios, a new improved SWC cache (which reads in and parsers SWC’s like playerglobal.swc and framework.swc once per workspace) is leveraged to further extend the improvements introduce in the SDK and the compiler . This new SWC cache will be part of Flex Builder 4 when it becomes available later on this year.
So let’s talk about some numbers. There are couple of applications the engineering team uses to measure some of these improvements, and here are some initial results:
- A really heavy and large MXML-based app: The performance test suite went from full compiling in four minutes with Flex 3 to two minutes with Flex 4, from 20 seconds to 15 secs using active incremental compile, and from 35 secs to 26 seconds with inactive incremental.
The incremental compilation numbers are based on a single file change, which affected zero other files. This will numbers will vary based on the number of files updated and the number of files affected by those
updates. When many files are affected the incremental compilation time is dominated by actual
compilation
- A really heavy ActionScript app (includes more than 6 different AS libraries): In this suite, the full compilation time went from 29 seconds with Flex 3 to 15 seconds with Flex 4, from 30 seconds to 11 secs using active incremental compile, and from 30 secs to 17 seconds with inactive incremental.
The incremental compilation time here consists of recompiling a few filess, link and writing out the library SWC, checking that number in the application or other libraries has been affected, and then linking and
writing out the application SWF.
Many of these performance optimizations have gone into the open source subversion Flex SDK trunk already, although not all of them are fully enabled in Flex Builder and the command line compilers yet (such as the new SWC cache).
Despite this, you can start enjoying some of those gains now. Take for instance Brian Deitte from Brightcove, who has backported some of the Flex 4 optimizations to Flex 3, obtaining 20 to 30% speedups when compiling BrightCove applications.
To summarize, the engineering teams are working hard to take the compilers to the next level, with gains in the order of 50%-100%. And we are just getting started, so stay tune!!!
Enjoy!!!
E-
One Comment
1 Brian Deitte wrote:
Hey Enrique, thanks for the mention. And for reminding me of the good old JRun 4 days.
Here’s a new post from me: http://www.deitte.com/archives/2009/02/flex_4_compiler.htm