View Full Version : Performance best practices questions

21 Jan 2010, 2:38 PM
We are trying to understand what should be best practice rules for coding
faster web application with GXT. The most performance issues we encounter on ie6.

Which initializations of the component is it better to do in constructor
and which should be done in onRender()?

If I call setHeading in constructor (in my understanding) it will just set it on
component, but not in DOM. If I call it in onRender() it will do double work set it in component and in DOM tree.

So if I do more initializations in constructors I reduce time for rendering phase (i.e. onRender()). And if I render component frequently (example as result of user
hiding and opening a GXT window with forms and tables) I will get better performance
if I move all initializations into constructor to reduce amount of work done during rendering...

Is my understanding correct?


Love Yao
21 Jan 2010, 8:01 PM
Yes, GXT allows components to defer the decision on the underlying DOM Element until render time and so the GXT Html component allows the actual parent tag type to be set at any time (before rendering)--different from GWT?

your idea about "reduce amount of work done during rendering." is intersecting . but I think the total time of the "DOM SHOWING in the HTML" is the same whatever you call setHeading in constructor or onRender. So I do not understand WHAT can we benefit from "reduce work during rendering."

I think "reduce work during rendering" is " Increase work during constructor "
it is equal in total value.

so WHAT can we benefit from "reduce work during rendering."