[jboss-dev] Improving scanning performance

Carlo de Wolf cdewolf at redhat.com
Fri Jun 5 17:22:00 EDT 2009


Andrew Lee Rubinger wrote:
> Bill Burke wrote:
>> I suggested this a year or two ago:
>>
>> * You should have a AnnotationScanner deployer that scans jars for 
>> annotations and puts an annotation database somewhere in memory that 
>> other deployers can reference.  (This might already exist, I don't 
>> know).
>
> This should be served by MDR (metadata repository) subproject of MC:
>
> http://anonsvn.jboss.org/repos/jbossas/projects/jboss-mdr/trunk/
>
> ...which as I understand is able to collect type information without 
> the need for classloading (via Javassist).
>
> Something I'd discussed a bit with Ales awhile back is refactoring 
> jboss-metadata to instead of using reflection a la:
>
> http://anonsvn.jboss.org/repos/jbossas/projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractProcessor.java 
>
>
> ...to instead read from MDR.  I admittedly haven't yet digged too much 
> here, but since you ask the question... ;)
>
> S,
> ALR
At the end of the day MDR still does reflection, see 
org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader. 
Performance wise it's even worse because it scans for methods / fields 
and such to match a signature.

So what used to be fast with advisor.resolveAnnotation(method, 
annotationType) is now horribly slow, because of MDR. Which is a bummer, 
because almost every interceptor we've got does something like that.

Carlo



More information about the jboss-development mailing list