Bill,
We have encountered the same issue with the application we are
building. We have a data tree that represents data in a hierarchy.
The tree is dynamically loaded and for most items it works just fine
as there aren't very many items to load. However, a few of the
hierarchies have many sub-items (1000+) and the browsers hang.
We haven't solved this problem however we have noticed the following:
* The Javascript interpreter used makes a huge difference. Firefox
will load the tree items relatively quickly using a limited amount of
memory. Safari (mac & windows) is even better. IE 6/7 is the worst -
it consumes the most cpu and memory to the extent where it will
consume all the memory on my computer.
* Adding items to the tree using a deferred command helps improve the
user experience (see example below). This allows for the browser to
process other events while the tree is still loading and not
completely hang. We also added the % loaded that is updated with each
deferred command so the user can see how slow/fast the loading is and
when it is expected to finish.
private void deferLoadTreeItems(final Iterator it) {
DeferredCommand.addCommand(new IncrementalCommand() {
public boolean execute() {
//add items 10 at a time
for (int i = 0; i < 10 && it.hasNext(); i++){
addTreeItem(it.next());
}
//repeat until no more items
return it.hasNext();
}
});
}
* In our application we added a search function that allows people to
search for a particular data item. If a user knows the name of the
particular layer they are looking for they can search for it and see
just the single layer. This helps the user, but does not solve the
issue.
Emily
> Thanks for the reply. The problem is that for most of the cases, theTreewidget is perfect for what we do. We have heirarchical data that
> needs to be browsed that fits very nicely into aTreeformat. The
> 1000 items is kind of the worst case and is fairly rare. However,
> there are a fair number of places where we have say, 2-5 hundred items
> and these take forever to render as well. We have theTreeinside a
> > seconds and may render thetreeunusable as you say . Try a simple
> > example program to demonstrate this. I think you should ask yourself
> > what use atreenode with 1000 children is to a user and maybe look at
> > a different approach to display the information. Normally where a
> > server call might return 1000 items for display one would introduce a
> > paging/filtering system of some kind, but that's not easy with aTree,
> > so maybeTreeis not the right Widget for your task at hand or it
> > needs to be used in conjunction with something else to take care of
> > the "big ones".
>
> > regards
> > gregor
>
> > On Jun 20, 7:09 pm, "Bill C." <
billche...@yahoo.com> wrote:
>
> > > Hello GWT gurus,
>
> > > I have an application that uses aTree. When expanding a node of the
> > >TreeI make a server call to find the items to populate the next level
> > > of thetree. The server call returns relatively quickly. If there
> > > are relatively few (say 1-100) items to add to the TreeItem just
> > > expanded, everything seems to perform reasonably well. However,
> > > sometimes there are 100s of items returned from the server call (maybe
> > > up to 1000 sometimes). In these cases it just takes forever to
> > > populate thetreeand have it display. Theperformanceis so bad it
> > > makes the application unusable.
>
> > > Also, I have noticed that on some workstations, the CPU usage pegs
> > > during the population of thetree. I've got a pretty fast workstation