10

Did anybody else notice that there is a huge performance difference between a TreeViewer and a TableViewer (TreeViewer is much faster).

I have a Table containing CellEditors (with EditingSupport) with about 30 columns and when I'm scrolling it, especially horizontally, it's very slow. Also multi cell selection is slow too.

I changed the table to a Tree (just changed the main TableViewer to a TreeViewer and the specific classes) and there is a huge performance gain.

Why is this? Both table and tree have the same structure, implement and extend the same classes and tree is the one with more functionality. Is this fixed in newer versions of eclipse or should I just migrate my table to a tree with no children?

P.S. I'm using SWT and JFace 3.7 on win7.

Thanks in advance.

Lori
  • 562
  • 5
  • 24
  • Perhaps adding the SWT.VIRTUAL style would improve the performance of your TableViewer? See here: [JFace’s Viewers Performances](http://manuelselva.wordpress.com/2008/04/16/jfaces-viewers-performances/) – Balder Feb 14 '14 at 11:49
  • Well, even if it does improve, the question still remains; why is the tree faster than the table, considering both have the same styles, providers etc. – Lori Feb 14 '14 at 16:31
  • 1
    The tree and table will use different underlying native controls, it might be something to do with that. – greg-449 Feb 15 '14 at 08:27
  • SWT uses native contols for these which will differ. It may also be the other way around on a different OS. If you are dealing with large tables/trees I would recommend not to use either but http://www.eclipse.org/nattable/. I am using it for a larger project and apart from its complexity its very good and fast. – timm Aug 28 '14 at 05:22

1 Answers1

1

For performance, try using the ILazyTreeContentProvider.

See also this post: Eclipse RCP - ILazyTreeContentProvider implementation is unexpectedly eager.

DrKaoliN
  • 1,346
  • 4
  • 25
  • 39