[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Tree and TreeItem help

ok, I see what you're saying.  This looks like
https://bugs.eclipse.org/bugs/show_bug.cgi?id=129457 .  I don't have a
definite workaround to suggest, but if possible you may wish to experiment
with showing your data in a slightly different way.  For example, rather
than having 100000 root-level items, could the items be somewhat grouped
into child items?  This would reduce the root-level item count, and could
make navigation easier for the user (depending on how they're using the data
in the tree).

Grant

"Nadilson Ferreira" <nadilson@xxxxxxxxx> wrote in message
news:ehd2ck$pn7$1@xxxxxxxxxxxxxxxxxxxx
> Hi Grant,
>
> I'm using a SWT.SetData handle to perform database queries for the all
> sub-items. Nevertheless, it is not bing called when I call clearAll.
>
> I tested by creating a 100.000 items tree(table) and then calling
clearAll,
> and in the SWT.SetData handle a println just to check. Once the table is
> cleaned the SetData listener is not invoked. Therefore, no database
> operation is being performed during the cleanup. But, the cleanup is 'til
> taking to long.
>
>
> "Grant Gayed" <grant_gayed@xxxxxxxxxx> wrote in message
> news:eh7uej$ccd$1@xxxxxxxxxxxxxxxxxxxx
> > Hi Nadilson,
> >
> > Do you know precisely where the performance problem is occurring?
> > Accessing
> > the database is usually (or at least should be) the slowest part in
these
> > scenarios.  clearAll() and setItemCount() should not be expensive by
> > themselves, though they could appear to be if your SetData listener does
> > anything that's time-consuming.  And which platform do you see this on?
> >
> > Grant
> >
> >
> > "Nadilson Ferreira" <nadilson@xxxxxxxxx> wrote in message
> > news:eh14i1$rf0$1@xxxxxxxxxxxxxxxxxxxx
> >> Hi All,
> >>
> >> I'm facing a trick problem with Tree/TreeColumn/TreeItem when creating
> >> and
> >> cleaning up the Tree content. I need to perform queries to a database
and
> >> show the result set in a table. But for instance, one query can return
> >> 100.000 items and the direct next query just 10. After executing the
> >> query
> >> for populating the Table (Tree+TreeColumn), I'm calling
Tree.clearAll(),
> > in
> >> order to clean all content. But the performance is really bad.
> >>
> >> // fragment
> >> public void setInput(RootNode root) {
> >>   tree.clearAll(true);
> >>   if (root != null) {
> >>      tree.setData(root);
> >>      tree.setItemCount(root.getChildren().length());
> >>
> >>      if (tree.getItemCount() > 0) {
> >>         tree.showItem(tree.getItem(0));
> >>      }
> >>   }
> >> }
> >> // end fragment
> >>
> >> Do you guys have any suggestion?
> >>
> >> Thanks,
> >>
> >> NF
> >>
> >>
> >>
> >
> >
>
>