JFace TableViewer vs TreeViewer - performance
Asked Answered
H

1

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.

Helmuth answered 14/2, 2014 at 10:6 Comment(4)
Perhaps adding the SWT.VIRTUAL style would improve the performance of your TableViewer? See here: JFace’s Viewers PerformancesHeaume
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.Helmuth
The tree and table will use different underlying native controls, it might be something to do with that.Dogtooth
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 eclipse.org/nattable. I am using it for a larger project and apart from its complexity its very good and fast.Teakettle
Q
1

For performance, try using the ILazyTreeContentProvider.

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

Quasimodo answered 23/9, 2015 at 7:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.