GXT Performance Issues
- by pearl
Hi All,
We are working on a rather complex system using GXT. While everything works great on FF, IE (especially IE6) is a different story (looking at more than 10 seconds until the browser renders the page).
I understand that one of the main reasons is DOM manipulation which is a disaster under IE6 (See http://www.quirksmode.org/dom/innerhtml.html).
This can be thought to be a generic problem of a front-end Javascript framework (i.e. GWT) but a simple code (see below) that executes the same functionality proofs otherwise. In fact, under IE6 - getSomeGWT() takes 400ms while getSomeGXT() takes 4 seconds. That's a x10 factor which makes a huge different for the user experience !!!
private HorizontalPanel getSomeGWT() {
HorizontalPanel pointsLogoPanel = new HorizontalPanel();
for (int i=0; i<350; i++) {
HorizontalPanel innerContainer = new HorizontalPanel();
innerContainer.add(new Label("some GWT text"));
pointsLogoPanel.add(innerContainer);
}
return pointsLogoPanel;
}
private LayoutContainer getSomeGXT() {
LayoutContainer pointsLogoPanel = new LayoutContainer();
pointsLogoPanel.setLayoutOnChange(true);
for (int i=0; i<350; i++) {
LayoutContainer innerContainer = new LayoutContainer();
innerContainer.add(new Text("just some text"));
pointsLogoPanel.add(innerContainer);
}
return pointsLogoPanel;
}
So to solve/mitigate the issue one would need to -
a. Reduce the number of DOM manipulations; or
b. Replace them with innerHTML.
AFAIK, (a) is simply a side effect of using GXT and (b) is only possible with UiBinder which isn't supported yet by GXT.
Any ideas?
Thanks in advance!