Bug 212881 - [Viewers] Faster add() required for AbstractTreeViewer
Summary: [Viewers] Faster add() required for AbstractTreeViewer
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 212882
  Show dependency tree
 
Reported: 2007-12-13 09:35 EST by Serge Beauchamp CLA
Modified: 2019-09-06 15:35 EDT (History)
2 users (show)

See Also:


Attachments
Diff file for AbstractTreeViewer that contains the change required to support add() with elements already filtered and sorted (4.58 KB, text/plain)
2007-12-13 09:37 EST, Serge Beauchamp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Beauchamp CLA 2007-12-13 09:35:53 EST
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%.
Comment 1 Serge Beauchamp CLA 2007-12-13 09:37:19 EST
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
Comment 2 Boris Bokowski CLA 2007-12-13 11:17:32 EST
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
Comment 3 Boris Bokowski CLA 2009-11-26 09:48:20 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 4 Eclipse Webmaster CLA 2019-09-06 15:35:38 EDT
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.