PDA

View Full Version : too heavy app



MichaelOstrovsky
26 Sep 2009, 7:07 AM
i noticed our app is way too heavy , containing thousands of dom elements, causing heaviness and slowness ( 200 mb ram for a web app without leaks ?! ).

i think its caused mainly by piggish dom use of extjs , where each small component like button /panel/etc needs tens of elements within elements within elements.
while its obvious that every element have its purpose and not rendered just for the fun, im very interested in relatively simple methods to reduce it.
im asking for help or directions to target this very general issue. maybe someone even got a guide about this that i missed in the research.

by the way, we are still stuck with ext 2.2.1 because all our hacks that doesnt work on ext3. how well ext3 actually targets dom usage optimizations ?

thanks in advence.

mjlecomte
26 Sep 2009, 2:43 PM
I know there is ongoing work for Ext 3.1 regarding memory leaks/optimizations.

aconran
27 Sep 2009, 9:35 AM
As MJ stated we've been combing through the entire framework for memory leaks and optimizations in Ext 3.x. These will be publicly available with the Ext 3.1 release.

Regarding the issue at hand with Ext 2.2.1, I would review your usage of components. Make sure you are not overnesting, if you are frequently using layout 'fit's or having to turn off border's to make things look correct; you are probably overnesting.

Make sure you are using the appropriate component for your situation, if you just need some simple markup you can use BoxComponent instead of an Ext.Panel. If you need a simple container without all the framing of a Panel you can use an Ext.Container.

Make sure you are using deferred rendering appropriately. There's no need in rendering a component to the dom if it has not been seen yet. The natural way of Ext prevents this but I see many people use configurations like renderTo to render their components to the dom manually.

Many of the components we have to have extra markup so that we can have our extensive cross-browser support list and pixel perfect layouts. If you are targetting a specific platform its possible you could eliminate some of this markup (this would deviate significantly from standard Ext so it may be difficult to support and upgrades would be very difficult). For that reason alone, I wouldn't recommend that specific approach.