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 173679 - 40s - loading commons-logging.properties is too expensive
Summary: 40s - loading commons-logging.properties is too expensive
Status: RESOLVED DUPLICATE of bug 171810
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-10-03 10:39 UTC by mklaehn
Modified: 2011-04-13 15:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 159472


Attachments
nps snapshot (10.28 KB, bin/nps)
2009-10-03 10:39 UTC, mklaehn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mklaehn 2009-10-03 10:39:01 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3998-on-090927)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows Vista, 6.0, amd64

User Comments:
mklaehn: startup


Maximum slowness yet reported was 40308 ms, average is 40308
Comment 1 mklaehn 2009-10-03 10:39:06 UTC
Created attachment 88782 [details]
nps snapshot
Comment 2 Stanislav Aubrecht 2009-10-05 09:23:48 UTC
all the waiting time is in org.netbeans.ProxyClassLoader.getResources()
reassigning to performance team for evaluation
Comment 3 Jaroslav Tulach 2009-10-05 09:48:58 UTC
If I am not mistaken there are optimizations for loading classes that open only the JAR that contains the desired 
package. Looks like in case of default package, such optimization is not working. The snapshot
http://statistics.netbeans.org/exceptions/exception.do?id=271998
shows that Thread.contextCL().getResources("commons-logging.properties") opens more than 13 JARs (probably much more) 
in spite of there being at most one or two who define these properties (or even something) in the default package.
Comment 4 Petr Nejedly 2009-10-05 14:16:32 UTC
Well, the module system handles package-coverage for whole jars and file coverage for everything under META-INF, but so
far it ignored all the content of the default package (or maybe it noted it under the package-coverage that the default
package is non-empty). So far, loading anything (except few, ehm, exceptions) from the default package was forbidden
anyway. Maybe commons-logging.properties is one of those exceptions?
Comment 5 Jesse Glick 2009-10-05 16:07:51 UTC
It proved impossible to not load resources from the default package; too many third-party libraries do so as a routine
part of startup, and it is too late to change this poor idiom because they are documented to look there!
Comment 6 Jaroslav Tulach 2009-10-07 13:18:15 UTC
Moreover these poorly designed open source libraries become part of regular NetBeans releases (like the 
commons-logging) which means our classloading mechanism from default package shall be improved, otherwise all users of 
the IDE will suffer.

Petr mentioned that the system can know whether default package is empty or not. I do not think it is using this 
information now, but that would be good initial step. Right now the amount of such modules is going to be low, so 
opening all of them would be improvement and probably fine for now.

Comment 7 Jesse Glick 2009-10-07 17:09:53 UTC
Right, I guess no more than a dozen modules would have anything in the default package, so a simple iterative search
through them should be fast enough for our purposes.
Comment 8 Jaroslav Tulach 2011-04-13 15:38:07 UTC

*** This bug has been marked as a duplicate of bug 171810 ***