2 Replies Latest reply on Nov 20, 2007 4:52 AM by levancho

    Flex Application  Size concerns

    levancho Level 3
      I have been seeing articles, which talk about alarming sizes that flex application grows, etc etc ... and I have not seen any fundamental proof that points out concrete bottleneck that it can create, for some developers app size more than 500 KB is alarming for others there is 1MB limit and for some fundamentally extremist group there might be hard limit of 200 kb for main swf only etc ...
      . now some might say depending on a runtime environment size does matter. so I have to base on a worst case scenario : internent (undetermined user connection speed, unknown user environment) .
      NOTE: (all written here is strictly my opinion and it is subject of your personal justification).
      1) 1 MB fear : I can tell you right away that unless there are some nonsense embedded resource in application, 1MB main swf file is a lot of lines of code, (I mean a lot) I have application that has over 50,000-60,000(atleast) lines of combined code (mxml and AS3) (not including framework itself) main.swf file and it only weights little more than 600 KB, to me thats pretty good, together whole application with modules weights about 2 MB(inexternalized ) and about.1.2 mb(qith externalied link optimization) , but since application uses distributed module loading architecture there is 0(Zero) noticeable loading time .Majority of current internet users are way above 128 Kb connection speed( I get mighty 6mb for regular cable internet) , so in average , loading of 1 MB file takes literally less than 5 -8 seconds.
      (common now, some web pages with poor configuration take 10-20 seconds to load , especially if they are ajax abused :)). to summarize, complains like : "why there is 100 kb extra in swf file lalala", "why cant adobe not include whole sdk etc etc etc" is completely unfundamental complain, which has very limited justifiable use cases.
      We have to realized that currently ther eis reasonably powerful average of computers owned by users, averaging majority with P4 (or amd equivalent) or higher and 512mb or higher Ram.




        • 1. Re: Flex Application  Size concerns
          savyasachi
          levancho,

          Thanks for sharing your thoughts on Flex app and the environment sizes...etc. I am encouraged by the specifics you provided below especially with the statement "I have application that has over 50,000-60,000(atleast) lines of combined code (mxml and AS3) ". For some reason I am not able to achieve this. For ex: I have an mxml file which represents a module and it has only 185 lines of code (no embedded resources) but the corresponding swf file is aroung 275 Kbytes. Am I missing any optimizations or configuration settings...etc. Looking forward to hear any tips on how you are achieving this?

          Thanks for the help and your posting.

          savyasaachi
          • 2. Re: Flex Application  Size concerns
            levancho Level 3
            first you have to tak in account a frameworks content which is little over 100 kb soo from start the size ratio will be unbalance meaning that you might have one line of code and size will be still over 100 K, for everything else , I strongly suggest to disect your application into modules if possible, Modules is one of the most underastimated features in flex I think which on other hand give lot more power than just loading arbitraty code at any point of time, it gives lot more, including code size optimization,
            there is also a great python script that even further minimumizes your frameworks file size by just including a components that you have used , I think its done by Ted, http://www.onflex.org/ted/2006/04/rslbuilder-or-put-your-flex-apps-on.php