This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 31698

Summary: [TTV] TreeTable view does not scale well
Product: platform Reporter: Tim Lebedkov <lebedkov>
Component: ExplorerAssignee: Jiri Rechtacek <jrechtacek>
Status: VERIFIED FIXED    
Severity: blocker CC: tasklist-issues, ttran
Priority: P2 Keywords: PERFORMANCE
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 30150    
Bug Blocks:    

Description Tim Lebedkov 2003-03-05 17:06:47 UTC
Suggestions view is too slow while showing more than 1000 
tasks (try to scan tasklist sources). Scrolling is slow. 
Open all category nodes and try to sort on a column. It 
takes about 10 seconds on my AMD 1500 with 1600 
suggestions.

Tim
Comment 1 Torbjorn Norbye 2003-03-07 04:33:14 UTC
I ran Sun's performance collector on the code tonight and saw that for
the scan, most of the time is taken by the PMD parse, followed by the
java parser parse job. These times together dwarfs the rest. Not much
I can do about that.

But I just now realized you're talking about explorer-performance for
a large number of tasks after the scan has completed. Yes, that's
probably a problem. Tonight I was investigating the TreeTableView to
try to help fix bug 30150, and I saw some pretty scary code in there;
the most scary one is probably getChild(): for EACH node in the
display, it will sort the list! And then iterate through the list to
find the nth child!!! I don't believe I need a performance collector
to guess where the performance problems are with sorting - that code
is definitely suspect. Here's the function - note how this gets called
repeatedly for every node to be shown:

        public Object getChild(Object parent, int index) {
            if ( ( sortedByProperty != null || sortedByName ||
noSorting ) && parent instanceof VisualizerNode ) {
                VisualizerNode n = (VisualizerNode)parent;
                java.util.List list = n.getChildren();
                sort ( list );              <======== SLOW; O(nlogn)
                return list.get( index );   <======== SLOW; O(n)
            }
            else
                return super.getChild( parent, index );
        }
Comment 2 Marian Mirilovic 2003-03-07 08:18:35 UTC
Jirka, sorry :(
Comment 3 Jiri Rechtacek 2003-03-10 09:00:54 UTC
I'm going to see after when 30150 will be solved, at least in next
release.
Comment 4 Jiri Rechtacek 2003-03-14 18:23:31 UTC
fixed in main trunk, sort() is called only when sorting changed, not
from getChildAt(). An changed order in model is propagated to
VisualizerChildren, the tree model doesn't need to calculate each
child on given position. This fix will be merged to release35 together
with fix of issue 30150.
Comment 5 _ ttran 2003-03-14 22:35:17 UTC
ugly performance problem, raised prio to P2 to make sure it will be
fixed in 3.5
Comment 6 Jiri Rechtacek 2003-03-17 09:42:52 UTC
fix merged to release35 branch
Comment 7 Marian Mirilovic 2003-04-03 16:09:34 UTC
Tim L.,
can you verify this issue?

Thanks in advance.
Comment 8 Tim Lebedkov 2003-07-08 17:39:51 UTC
It's about 10 times faster now. Thank You.