Bug 73802 - [Progress] DeferredTreeContentManager needs an upper limit for entries
Summary: [Progress] DeferredTreeContentManager needs an upper limit for entries
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P4 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2004-09-13 16:49 EDT by Chris Wiebe CLA
Modified: 2009-08-30 02:11 EDT (History)
0 users

See Also:


Attachments
test case (apply against org.eclipse.ui.examples.job) (6.77 KB, patch)
2004-09-13 16:55 EDT, Chris Wiebe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Wiebe CLA 2004-09-13 16:49:37 EDT
When a large array of elements is passed into
DeferredTreeContentManager.addChildren (through IElementCollector.add(..)) the
UI thread is completely blocked while the treeviewer is being updated.  This
nearly brings my entire system (Windows 2000) to a crawl.
Comment 1 Chris Wiebe CLA 2004-09-13 16:55:00 EDT
Created attachment 14524 [details]
test case (apply against org.eclipse.ui.examples.job)

Apply this patch against org.eclipse.ui.examples.job.  This will create a large
number of SlowElement children to illustrate the problem.

Start the runtime workbench and open the lazy trees view.  Check the "batch
returned children" checkbox.  Open an item in the tree.  The UI will block
while the item displays "pending...".
Comment 2 Tod Creasey CLA 2004-09-14 08:50:15 EDT
The purpose of this deferred update is to only do a few a time - we do not 
control the amount that is sent and leave it up to the developer.

Having said that we should add an upper limit to prevent his.
Comment 3 Chris Wiebe CLA 2004-09-14 11:35:57 EDT
My impression is the bottleneck seems to be in the way the tree is populated. 
It calls AbstractTreeViewer.createAddedElement() for every element in the array
and seems to spends an inordinate amount of time in indexForElement().

If I do as you suggest, and break up the array and pass it in smaller chunks,
the UI is more responsive but the tree flickers a lot as elements are added.  It
also takes a VERY long time to populate the tree.  When I use a normal content
provider the tree displays quickly, I guess since the tree viewer calls
contentprovider.getElements() directly and doesn't try to sort each element on
insert as it does with AbstractTreeViewer.add().

I guess maybe what I would have liked is a "batch mode" deferred content
manager.  On the first call to getElements() it creates the "pending" item and
runs the background job to fetch the children.  When the job completes, the
pending item is removed and essentially a refresh is done on the tree viewer -
through some mechanism it is passed the completed elements array in one step
(i.e. so it's treated the same as if getElements() had returned the complete
array the first time).
Comment 4 Tod Creasey CLA 2006-04-07 12:02:47 EDT
There are currently no plans to work on this feature
Comment 5 Denis Roy CLA 2009-08-30 02:11:15 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.