geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Hogstrom <m...@hogstrom.org>
Subject ClassLoading information
Date Mon, 30 Apr 2007 18:42:52 GMT
I did some profiling of DayTrader deploy (which takes almost 60  
seconds) to understand what is taking so long.  It appears that we  
spend a significant amount of time MultiParentClassLoader.loadClass 
().  We've been in here before and added some code to direct requests  
for specific class types to the SystemClassLoader (like java.,  
double, int, etc.).  This help performance a lot.  But that's old news.

I've been gathering some information on where we are spending the  
time and it appears that the single item that hurts us the most is  
classes that are not being found.  I add some code to cache the  
classes that are known to not exist in a hierarchy and the results  
were fairly impressive.

Startup time on my Mac goes from about 19 seconds to 15 seconds.   
That is just about a 20% improvement in startup time.

Deploy time for DayTrader goes from 62 seconds to 36 seconds (about  
1/2 the time).

I talked to Dain about this and its not really clear how to handle  
this.  One option is to implement the cache of classes that have not  
been found.  However, for entries in the ClassPath that are a  
directory its possible that a user might drop a class in and we would  
never find it once we failed.  We could put some kind of timer  
mechanism in to throw out entries that have not been referenced in  
some time interval.

I wanted to solicit some input on alternatives.

For those interested in how many times a loadClass fails with a CNFE  
I captured each failure by classloader and appended a number of times  
the class was looked for.  This can be found at

http://people.apache.org/~hogstrom/classNotFoundList.txt (It's about  
2MB)

or you can grab a zip file if you prefer.

http://people.apache.org/~hogstrom/classNotFoundList.zip

Mime
View raw message