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 172822 - [69cat] Navigator initializes not visible panels
Summary: [69cat] Navigator initializes not visible panels
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Rechtacek
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
: 176865 177846 182092 184780 187442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-23 00:15 UTC by mburgess
Modified: 2011-05-24 15:29 UTC (History)
24 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 157204


Attachments
nps snapshot (37.18 KB, bin/nps)
2009-09-23 00:15 UTC, mburgess
Details
nps snapshot (256.00 KB, application/nps)
2009-11-10 11:43 UTC, Michal Mocnak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mburgess 2009-09-23 00:15:27 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3959-on-090920)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Windows Vista, 6.0, amd64

User Comments:
aldobrucale: I have clicked on an error link in the output window for a failed hudson build. I think that the source file is downoladed in the EDT.

GUEST: Starting netbeans

GUEST: Opening NetBeans with a EJB Project opened.

GUEST: switch to a file tab

mburgess: Starting netbeans


Maximum slowness yet reported was 8469 ms, average is 4877
Comment 1 mburgess 2009-09-23 00:15:33 UTC
Created attachment 88154 [details]
nps snapshot
Comment 2 Exceptions Reporter 2009-09-23 00:15:37 UTC
This issue already has 9 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 3 David Simonek 2009-09-23 14:19:22 UTC
Passing to java, time is spent in rather expensive creation of java.debug.ClasspathNavigatorProviderImpl.getComponent()
- about 74% of reported time and java.navigation.ClassMemberPanel.panelActivated(...) - 18% of time.
Comment 4 Exceptions Reporter 2009-09-24 03:33:30 UTC
This issue already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 5 Exceptions Reporter 2009-09-29 14:53:51 UTC
This issue already has 11 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 6 Exceptions Reporter 2009-09-29 22:28:55 UTC
This issue already has 12 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 7 Exceptions Reporter 2009-09-30 12:25:38 UTC
This issue already has 13 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 8 Jan Lahoda 2009-10-07 12:50:11 UTC
java.debug.ClasspathNavigatorProviderImpl is not going to be changed - it is a debugging panel which is not enabled in
release builds. Moreover, it appears that majority of the time is spent in classloading (classes cannot be loaded during
startup and classloading can block almost any activity for the first time - what is the recommended approach? Should
each and every feature implement its own class preloading, possibly wasting memory in perm gen?).

What seems strange to me is that navigator creates all panels, not only the one that is visible - seems pretty wasteful
to me. Is there a reason why only the visible panel could not be created?
Comment 9 Jaroslav Tulach 2009-10-07 17:10:43 UTC
If I understand correctly the classpath panel is just one of available panels in the combo box and very likely not the 
one that is selected. Such panels shall not be initialized until they are needed. Initialization would be bug in in 
the navigator implementation and/or API. Looking at NavigatorTC.java it is probably bug in the implementation that 
shall not be hard to optimize:

diff -r c45e9c6c96fa spi.navigator/src/org/netbeans/modules/navigator/NavigatorTC.java
--- a/spi.navigator/src/org/netbeans/modules/navigator/NavigatorTC.java Wed Oct 07 15:34:02 2009 +0200
+++ b/spi.navigator/src/org/netbeans/modules/navigator/NavigatorTC.java Wed Oct 07 18:09:35 2009 +0200
@@ -200,6 +200,7 @@
             JComponent curComp = null;
             int i = 0;
             boolean selectFound = false;
+
             for (NavigatorPanel curPanel : panels) {
                 panelSelector.addItem(curPanel.getDisplayName());
                 curComp = curPanel.getComponent();
@@ -216,6 +217,7 @@
                 if (curPanel == select) {
                     selectFound = true;
                 }
+
                 i++;
             }
             if (selectFound) {
Comment 10 Jan Lahoda 2009-10-07 17:24:29 UTC
A bug fixed by adding two empty lines? Interesting.
Comment 11 Exceptions Reporter 2009-10-10 23:00:27 UTC
This issue already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157204
Comment 12 David Simonek 2009-10-12 15:54:27 UTC
jtulach, could I ask for proper patch? The last one seems to be invalid, just two blank lines, thanks.
Comment 13 David Simonek 2009-10-15 09:16:33 UTC
Hmm, no response. Anyway, as jlahoda explained, major part of slowness comes from debugging panel, not used in release,
so I'm downgrading to P3,
Comment 14 Jaroslav Tulach 2009-10-15 09:56:02 UTC
My "patch" just identifies place where the proper fix shall occur.
Comment 15 David Simonek 2009-10-15 10:24:34 UTC
I see. I saw diff and automatically thought that it means the patch...
Comment 16 Michal Mocnak 2009-11-10 11:43:03 UTC
Created attachment 90737 [details]
nps snapshot
Comment 17 David Simonek 2010-03-29 16:30:59 UTC
*** Bug 176865 has been marked as a duplicate of this bug. ***
Comment 18 David Simonek 2010-03-29 16:31:47 UTC
*** Bug 182092 has been marked as a duplicate of this bug. ***
Comment 19 Jaroslav Tulach 2010-03-31 07:58:09 UTC
Just duplicated bug 182092 is P2.
Comment 20 Jaroslav Tulach 2010-04-23 09:34:12 UTC
*** Bug 184780 has been marked as a duplicate of this bug. ***
Comment 21 Jesse Glick 2010-05-04 17:10:49 UTC
*** Bug 177846 has been marked as a duplicate of this bug. ***
Comment 22 Antonin Nebuzelsky 2010-05-11 13:27:03 UTC
Reassigning. Jirka will take this bug now.
Comment 23 Jiri Rechtacek 2010-05-12 15:11:26 UTC
core-main/rev/f14327240010
Comment 24 Jaroslav Tulach 2010-05-13 06:21:41 UTC
I am glad this long time open, annoying performance problem has been fixed.

I'd like to see the "lazy" behavior be verified by a simple test, through. Imagine what can happen when you will be working on completely different project and someone else touches this code!
Comment 25 Quality Engineering 2010-05-14 04:11:03 UTC
Integrated into 'main-golden', will be available in build *201005132200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 26 Jan Lahoda 2011-05-24 15:29:59 UTC
*** Bug 187442 has been marked as a duplicate of this bug. ***