PDA

View Full Version : Poor performance with custom widget



googelybear
21 Feb 2009, 9:34 PM
Hi,

I've created a custom widget which takes quite a long time until it gets displayed (~5seconds)
The widget is based on nested VerticalPanels and HorizontalPanels. It subclasses LayoutContainer and the widget structure is created in the constructor.
Are there some general rules on how to create fast widgets or what to avoid (common pitfalls etc.)?
Would it be better to subclass the recently released Composite class?

thanks for any suggestions!

Martin.Trummer
24 Feb 2009, 1:33 AM
+1 from me - I am also interessted in such guidelines.

darrellmeyer
11 Mar 2009, 8:45 PM
It is hard to comment on your particular performance numbers without seeing the code.

I would recommend looking at 2 things:

1) How many DOM elements are being created by your custom component. Creating elements is expensive, so the more complex element structure, the longer execution takes.

2) GXT containers vs. GWT panels. GXT containers and layouts are great when laying out your applications interface. They provide precise control of your interface including area resizing. For these benefits, there is a cost. Basically, you are controlling sizes and positions via JavaScript, rather than natively by the browser. You should not rule the use of GWT panels when building GXT applications. If you are using many GXT HorizontalPanels and VerticalPanel's I would suggest you consider the GWT version of the same widgets. As the GXT version uses layouts which the GWT panels do not. But the best choise really will depend on your particular use.

googelybear
12 Mar 2009, 2:58 AM
yeah I know - unfortunately I cannot publish the code publicly.
It appear to be faster when I populate the widget with data (with data retrieved from a server) before showing it
so instead of the sequence
construct/show/populate (here the user actually sees how the page gets built up) I would use
construct/populate/show (the user sees the complete page when it gets displayed).

thanks for the info about the vp/hp, I'll try to replace my gxt vp/hp with the gwt version and see how this works.