views:

971

answers:

3

I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going.

I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested in seeing a report of the sizes of all the classes and resources in my application and it would be a huge bonus if I could also view their dependencies. Not knowing how the code is compiled I'm not sure if this is even possible, but it seems like it should since the compiler can give me the sizes of individual classes linked from other libraries.

I did some searching around, but couldn't find anything helpful. Everything points to the optimization techniques of modularizing and externally linking libraries, which I understand and will implement, but I would really love some more detailed reports of what my compiled application looks like.

To be clear, I'm not really interested in tips on how to reduce the file size, just a report on what is used for and which classes are referencing what.

Anybody have any ideas?

CORRECTION - The link report does show all classes. My particular project in Flex Builder had several CSS files set to compile to swfs. My link report for the main app was being overwritten by these css compiles!

+2  A: 

The link report actually contains all compiled classes and not just the ones in external libraries (at least with the Flex 4 SDK). There is an xsl available that will generate an html file of the link report so it is easier to read.

Check this post: http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/

Christophe Herreman
You are right, the link report does show all classes.The problem turned out to be that I also had several css files set to compile in my project. Flex builder uses the same compiler options for every swf it creates in the project. The link report for my app was being overwritten be the last css.
Matt Guest
+2  A: 

There is a command-line utility called flash.swf.tools.SwfxPrinter in swfkit.jar, which comes with Flex Builder (or the plug-in or the SDK) and which you can use to analyze information about class sizes. Joe Berkovitz wrote some good instructions on how to make use of it in his blog, and he was working on an AIR-based GUI tool that leverages it, but I'm not sure if he ever published the tool. Still, you can use his instructions to leverage the utility directly from the JAR.

erikprice
The analysis tool is now available here: http://code.google.com/p/it-depends/
Matt Guest
Thank you very much for sharing!
bug-a-lot
A: 

I found a handy little AIR app that really helps organize the link report info.

http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/

It's old but still works very well.

Jason MacDonald