[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Improving the process of applying AnnotationPlugins on M
jaikiran
do-not-reply at jboss.com
Fri Apr 3 10:09:08 EDT 2009
"alesj" wrote :
| Although this optimizes things, it's wrong.
| There is a reason why we go over MDR. ;-)
|
| The reason is that annotations can be added to class, ctor, method or field
| via XML or programmatically (with MDR api).
|
I see. I had no clue what the getComponentMetaData stuff was doing :-)
The real reason why this AnnotationPlugin processing appears as a hotspot is because the logic looks for annotations on each and every method and fields of the class hierarchy (ex: it reaches upto Object.notify()). My initial intention of attempting a patch was to reduce the number of methods for which the ComponentMetaData is created. i.e. pick only those methods which have annotations, in particular - those annotations which are relevant to plugins.
"alesj" wrote :
| Perhaps we can add some annotation you can put on the class
| which list possible annotation classes, hence only checking those annotation plugins.
|
| e.g.
|
| | @MCAnnotations(Inject.class, EJB.class, Resource.class, PersistenceContex.class) // this will be added via MDR / metadata
| | public class MyEJB implements IMyEJB
| |
|
| And we would have a check in CommonAnnotationAdapter for this annotation,
| only applying those annotation plugins that match found annotation classes.
| If no such annotation exists, run them all as we do now.
That might partially improve this performance, because even if the MC bean was applied that annotation (at class level), the logic would still scan a lot of methods/fields (which most of the times don't have any MC annotations to be processed).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223314#4223314
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223314
More information about the jboss-dev-forums
mailing list