0

We're converting quite a large Flex project from a monolithic web application project type to multiple projects where most of the existing files (~2000) will newly live under a Library project and there will be multiple runnable projects beside it (like web version and a desktop version).

What concerns us is the compilation time. It used to be something like a minute (already more that we would have liked) but now it easily takes ~10 minutes which is unacceptable.

Is it expected to see such a big difference when moving from MXMLC compiler to COMPC? I know MXMLC optimizes its usage and will skip files that are not used in the application it is expected that the COMPC build would be slightly slower as it compiles more files but I don't think the difference should be 10 fold, should it?

Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
  • I have very recently answered a very similar question here: http://stackoverflow.com/questions/9173625/flex-4-5-to-long-build-process/9174169#9174169. By the way: 2000 files in one library is still monolithic, you could just as well have left it in one project. – RIAstar Feb 09 '12 at 17:37
  • Thanks for answering, however, we were already using most of the optimizations on our previous setup (monolithic SWF) and the problems we currently have are new and they most probably have to do with the switch from MXMLC to COMPC. Is there something internal radically different which would cause 10 times the build time? – Borek Bernard Feb 09 '12 at 17:43
  • The compiler does load all the files into memory, so you might try allocating the JVM it runs in some more. It's probably choking right now. But personally I would cut that huge library into manageable pieces (see last part of my other answer for more on that). – RIAstar Feb 09 '12 at 17:50
  • Yes, that would be ideal from programmer perspective but first, it cannot be done at the moment because of the complexity of the task, and second, are you sure that building 10 x 100 classes is faster than building 1 x 1000 classes. Increasing memory might help but again, building on the exactly same configuration with MXMLC was fine, only after the switch to COMPC the project is virtually impossible to work on. – Borek Bernard Feb 09 '12 at 18:02
  • MXMLC will by default include only the classes that are used in the project (it takes your main class and goes through all the imports), whereas COMPC includes the entire source folder, unless your options prevent it... Also, make sure you don't include all the library SWCs. – weltraumpirat Feb 09 '12 at 19:12
  • On a side note: The whole idea of splitting your larger project into smaller pieces to include as SWCs is that you don't have to compile the library code with every build - only when the libraries change... – weltraumpirat Feb 09 '12 at 19:20
  • Our use case is to have 99% of the code in library project(s) and only use runnable project types as light wrappers (having a Web Application, Desktop Application and Mobile Application using the same code base). In such case, almost every change anywhere in the codebase will cause SWC(s) to be recompiled so we can't really avoid it if we want to go this route. – Borek Bernard Feb 09 '12 at 21:38
  • I'd say break down the library into logical pieces. We have a similar scenario where we build lots of web applications on top of a framework developed in house, we have our internal framework/libraries split up into controls, utils, security, theme, etc. We use maven as a build tool, which makes it trivial to build a single "module" of the entire framework or to build the entire thing. From the top level were looking at 740 .as files and 137 .mxml files, 2000+ images etc. a full build takes 2min 9sec(includes demo projects but not unit testing, bamboo does that),each module about 40 sec. – shaunhusain Feb 09 '12 at 22:29
  • Thanks. Your build time is much better although it would still be too slow for a day to day usage for us. I guess we will have to find another way than to use SWCs. – Borek Bernard Feb 10 '12 at 06:22

0 Answers0