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 13813 - Optimize MultiURLClassLoader
Summary: Optimize MultiURLClassLoader
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2001-07-23 14:01 UTC by Jesse Glick
Modified: 2008-12-23 08:35 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-07-23 14:01:45 UTC
Rewrite MultiURLClassLoader to (1) not be a URLClassLoader, but open
JARs directly for speed; (2) find the packages in each module
immediately and never need to guess which package holds a class,
unless it can only be found in some non-MURLCL parent.
Comment 1 Petr Nejedly 2001-07-23 14:51:45 UTC
I was already looking at this issue, trying to write a new
ClassLoader for jars.
I have (for the beginning) abadoned the idea of pre-parsing
jars for all packages (it wasn't that slow, ~600ms for all modules,
but it doesn't count Manifest processing and will not scale good.
(Yes, when I came up with this idea, I was thinking about tons
of CNFEs, EmptyStackEs and PrivilegedActionEs, but not with
the way modules should behave - only few classes at the beginning))
 
My later idea was to have:
1) ProxyClassLoader that will handle loading from more parent loaders
(do the dirty work of fooling JDK's ClassLoaders idea), but won't load
anything itself (have the methods defined, but empty)
2) Have a JarClassLoader that will handle loading from a list of jars
and their extensions.

Ideas for speedup:
1. don't use CNFEs in the inner signaling. When SystemClassLoader
asks around all the OneModuleClassLoaders, it will save some time

2. (Have to be discussed) Ask the faster classloaders before the
slower ones, i.e. preferr MUCLs over unknown.

3. (Maybe) Have a map of the known packages shared between
MUCLs. There will be less virgin package openings and less
redundant informations. Every MUCL can then check
whether a CL from the map is in his parents (accessibe) or not
(surely CNFE, can't have one package in two loaders at once)

Maybe it would be best to have both implementations and compare
their performance/implications.
Comment 2 Petr Nejedly 2001-08-02 17:28:14 UTC
1) Implemented in org.netbeans.core.modules.ProxyClassLoader
& org.netbeans.core.modules.JarClassLoader

2) doesn't seem to be faster, abadoned
Comment 3 Jan Chalupa 2001-11-27 11:49:20 UTC
Target milestone -> 3.3.1.
Comment 4 Jan Chalupa 2001-11-27 11:52:47 UTC
Target milestone -> 3.3.1.
Comment 5 Petr Nejedly 2002-02-27 09:19:38 UTC
I think we've already done our best on this.
Comment 6 Jesse Glick 2002-02-27 10:10:00 UTC
Yes, I think so. #3 is not trivial; see the method
shouldDelegateResource: I don't know how a domain cache could be
shared in the presence of this method, without a lot of work.
Comment 7 pzajac 2003-01-22 10:00:59 UTC
resolved before year ->closed