my suggestion in addition would be.. do profillig and see which object is accumulating and not being destryoed even when you force garvage collect. Then see what is the conetent of that object.. most frequent cause is that .. those objects conatins reference to some thing that is presistent through out the system. and 5MB of main SWF also means that you have large asset folder.. find some way in decreasing your assets and do run time reference insted.You can do such time specially for images.
On Tue, Nov 20, 2012 at 2:41 PM, Naveen Sr <[email protected]> wrote: > Nitin, > > Here are my suggestions: > > There are two issues you are refering to: ONe is the start up time due to > swf and other being performance issues. > > 1) Firstly see the root cause on why the main swf is 5MB. > a) If this is due to the application code, then split to modules and > invoke these modules only when required. > b) If this is due to images ensure you are using RSL. However having > heavy images will also not help with RSL. Ensure you are converting the > images to vectored graphics using a good UX team. > c) If you are having embedded fonts, please externalise these as well. > d) follow the guide on livedocs to improve start up performance. > e) Another tip to improve the start up is , just load what is most > essential the first time. IN the background you can continue to load rest > of the modules. > > 2) After the above has been done, you could look at some of the following > for the performance: > a) If you are on Flex 3 and you observe in your code that you have > nested levels of containers, for example: > <Hbox> > <VBox> > <HBox> > > then this causes heavy consumption of memory on a large scale application. > Ensure you are using constraint layout for such scenarios. You will > immediatly see the runtime memory drop. If you are using flex 4 or have > option to migrate to flex 4 , please go for it. > > 3) As you said , please ensure you do not use setStyle and describeTYpe() > causes a whole set of framework level events and hits performance. > > 4) If you are using any live objects please do not use cacheAsBitMap. Use > this only if required for motion tweens. > > 5) usage of drop shadows and masks as well are very expensive. > > 6) After UI component has been used, ensure you are removing the object. > If you do not remove, on the memory snapshot you will see the number of > instances piling up. Example : A pop-up window which is being created > inside a method handler. So everytime you enter the method, you will see > the number increase and eating your memory. > > 7) Add weak listeners to events. > > 8) Wherever possible use vectors over arraycollection. This has helped me > big time and this was shared by an Adobe Evangelist to me. > > 9) Creating programatic skins is fast. However try to create re-usable > classes. You can trade off for finely created vectored images which are > super light weight too. > > These have been some of the tips that has helped me so far and my friends > in the same line. > > Hope this helps you out. > > Cheers, > Naveen > > On Tue, Nov 20, 2012 at 2:09 AM, Nitin Gopi <[email protected]> wrote: > >> Hi >> First I tell you what is the present scenario. >> I have an application which was not created using modules. It was >> developed years back. Now the application size has grown larger. When we >> compile it we get a singe swf file which is 5 MB in size. It takes so much >> time to load on the browser. Its the only swf in the debug folder. The >> compile time is also much more. >> Now my task is to do both, reduce the compile time as much as possible >> and also make it faster on the browser. >> So far I have done these things >> 1. I tried to look for loitering objects using flashbuilder profiler tool >> and found some of them. Then I assigned the objects to null as soon as its >> job was finished. I couldn't find the weak references. This has reduce >> memory leaks at many places. >> 2. Use of setStyle() is not the best way, so for that I used the styles >> in css. But do not know how much the performance will be improved. >> 3. We have been using embedded images for each button to show the skins >> for mouse hover, mouse click operations. This creates unnecessary images in >> the assets folder. As part of solution I tried to use a skinClass for the >> buttons. It has styles for mouse over, mouse click operations. One >> advantage is that we can get rid of all the button images inside the assets >> folder. But for each button one object of skinClass will be created. Is it >> a nice idea or I am doing something wrong here? >> 4. I also tried to put all the css files and images inside separate swc >> and link it as RSL in the project. It reduces the overall swf size and >> compile time is also reduced but not sure about the performance, will check >> it. >> 5. Is there anything else which I can do to reduce the compile time and >> increase the performance or if there is anything which I am doing wrong? >> >> Thanks >> Nitin >> >> >> On Fri, Nov 16, 2012 at 6:33 PM, Naveen Sr <[email protected]> wrote: >> >>> Hi Nitin, >>> >>> Yup I have done extensive work on prifiling with memory snapshots :) >>> >>> On Tue, Nov 13, 2012 at 8:34 PM, Nitin Gopi <[email protected]>wrote: >>> >>>> Hi All, >>>> Has anybody worked in the area of profiling flex applications. This >>>> includes finding memory leaks, improving compilation time and solving >>>> performance issues. >>>> >>>> Regards >>>> Nitin Gopi >>>> -- >>>> You can only depend on yourself. The cavalry ain't coming. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Flex India Community" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/flex_india?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Flex India Community" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/flex_india?hl=en. >>> >> >> >> >> -- >> You can only depend on yourself. The cavalry ain't coming. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Flex India Community" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/flex_india?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

