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 29834 - ProxyClassLoader.getPackage is slow
Summary: ProxyClassLoader.getPackage is slow
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on: 30093
Blocks: 20190 21675 28686 29339
  Show dependency tree
 
Reported: 2003-01-07 16:19 UTC by Jesse Glick
Modified: 2008-12-23 08:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Working patch - permits opt to be switched on or off (8.69 KB, patch)
2003-01-08 18:46 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-01-07 16:19:42 UTC
It seems that getPackage can be quite slow when
called from a class loader with deeply nested
dependencies; e.g. class loading for a module like
jwd seems to be much slower than for modules with
few dependencies. Possibly some sort of Fibonacci
recursion is happening. Find some way to speed up
class loader inheritance search generally, or at
least optimize getPackage specially - the domain
cache search does not seem to work for it currently.
Comment 1 Jesse Glick 2003-01-08 18:44:50 UTC
Initial patch seems to help on NB:

Average times: unoptimized  10.7500821908315
                 std. dev.  0.0138244002751103
                 optimized  10.4460347970327
                 std. dev.  0.0164806646809395
Improvement:                0.304047393798829
Percentage:                 2.8283262248743%

Patch just avoids recursion wherever possible and caches results a
little more aggressively. Also avoids recomputing
org/netbeans/modules/foo/ string from org.netbeans.modules.foo over
and over.
Comment 2 Jesse Glick 2003-01-08 18:46:19 UTC
Created attachment 8479 [details]
Working patch - permits opt to be switched on or off
Comment 3 Jesse Glick 2003-01-08 19:03:19 UTC
Numbers are more dramatic on S1SEE, presumably due to greater depth of
dependencies:

Average times: unoptimized  18.144784005483
                 std. dev.  0.0219925628913204
                 optimized  14.2167972564697
                 std. dev.  0.0371633602628928
Improvement:                3.92798674901327
Percentage:                 21.6480215351492%
Comment 4 Jesse Glick 2003-01-08 21:45:27 UTC
committed   * Up-To-Date  1.8        
core/bootstrap/src/org/netbeans/JarClassLoader.java
committed   * Up-To-Date  1.4        
core/bootstrap/src/org/netbeans/ProxyClassLoader.java
Comment 5 Marian Mirilovic 2004-03-14 11:31:09 UTC
verified