Community
Participate
Working Groups
Our product is populating a TreeViewer with several thousands rows. In order to improve performance, we are able to build the object structure, filter it and sort it in a background thread, and then call AbstractTreeViewer().add(Object parentElementOrTreePath, Object[] childElements)) in the UI thread to add the children in the TreeViewer. Unfortunately, the implementation of AbstractTreeViewer().add() performs another redundant filter and sort of the elements, which end up being quite time consuming when 15k elements are passed. In order to solve the problem, we have been making changes to org.eclipse.jface.viewers. AbstractTreeViewer to support adding children by adding another method to the class: public void addFilteredAndSorted(Object parentElementOrTreePath, Object[] childElements); Which does the same task as the add() implementation, but skips the additional filtering and sorting. In our tests, this change (and other) improve the performance of adding the new elements into the view by 50%.
Created attachment 85179 [details] Diff file for AbstractTreeViewer that contains the change required to support add() with elements already filtered and sorted Diff file for org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
Thanks for the contribution. I am reluctant to add this to our codebase without any tests - would you be able to provide JUnit test cases for the new functionality? See also http://wiki.eclipse.org/Platform_UI/How_to_Contribute
Hitesh is now responsible for watching bugs in the [Viewers] component area.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.