[jboss-dev] Improving scanning performance
Bill Burke
bburke at redhat.com
Fri Jun 5 18:40:55 EDT 2009
Carlo de Wolf wrote:
> 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.
>
So it actually loads each and every class and does reflection on it? It
is a very very bad idea...
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
More information about the jboss-development
mailing list