Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 42368

Summary: [Outline] Slow TreeViewer updates
Product: [Eclipse Project] Platform Reporter: Andre Weinand <andre_weinand>
Component: UIAssignee: Nick Edgar <n.a.edgar>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: boris
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 42264    
Bug Blocks:    

Description Andre Weinand CLA 2003-09-02 05:42:37 EDT
M3
- open org.eclipse.swt.internal.carbon.OS in Java editor
- in the outliner toggle the sort or the filter button
Observe: it takes 130 seconds to update the outline (on my 800MHz PowerBook)

- turn filter and sorting off
- in Java editor go to the end of the method list
- enter a new method
     void foo();
Observe: when typing the parenthesis the outliner updates reasonable fast and shows the new 
method.
- now turn on sorting
- at the end enter another new method
Observe: when typing the parenthesis everything locks up for about 130 seconds
Comment 1 Nick Edgar CLA 2003-10-01 00:32:57 EDT
Chris, can you reproduce this on your Mac in the latest build?
Comment 2 Nick Edgar CLA 2003-11-11 00:49:35 EST
Andre, is this still an issue in recent builds?
Comment 3 Andre Weinand CLA 2003-11-11 06:03:40 EST
Yes, adding a single method to OS.java takes 130 seconds if sorting is on and 0 seconds 
if it is off.
Toggling sorting takes 130 seconds too.
The problem is that appending single tree items to a tree node seems to be a O(n) 
operation on Mac OS X. If all items are added in one native operation it is fast.
As long as the JFace tree removes and adds all tree items in certain update cases, it will 
be slow. 
Comment 4 Nick Edgar CLA 2003-11-17 22:05:19 EST
Was not able to get to this for M5.
JFace reuses TreeItems where possible.
E.g. on a refresh, if only a single item has been added, only one TreeItem gets 
created.

There is no SWT API for creating multiple TreeItems in one go.
Comment 5 Andre Weinand CLA 2004-03-18 12:11:06 EST
I20040317
1.25 GHz PowerBook

Adding a single method to OS.java takes 55 secs if sorting is on and 0 secs if off. 
Toggling sorting in the outline for OS.java takes 100 seconds.
Comment 6 Steve Northover CLA 2004-04-29 14:47:26 EDT
Andre, please try this in tonights build.  If not better, assign the PR to 
SWT.  Thanks.
Comment 7 Andre Weinand CLA 2004-04-30 19:24:29 EDT
I20040317
1.25 GHz PowerBook

Adding a single method to OS.java takes 2 secs if sorting is on and 0 secs if off. 
Toggling sorting in the outline for OS.java takes 3 seconds.

That's a 30x speed improvement!
Very cool.
Comment 8 Nick Edgar CLA 2004-04-30 21:49:43 EDT
When you add the method in the unsorted case, are you adding it to the end of
the CU or the beginning?  Is there a difference in performance?

What about in the sorted case?  Does the method get inserted at the beginning,
middle, or end, and is there a difference?
Comment 9 Nick Edgar CLA 2004-05-03 11:37:00 EDT
Andre, can we close this now?  See also previous comment.
Comment 10 Michael Van Meekeren CLA 2004-05-04 16:56:38 EDT
marking as fixed