[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBMDR-1; LRU cache impl

alesj do-not-reply at jboss.com
Wed Jul 9 03:54:50 EDT 2008


"adrian at jboss.org" wrote : 
  | Why? There's little point caching the Memory or the AnnotatedElement loaders
  | which is all we use currently. It'd just be wasted cpu and memory. :-)
Marko did some investigation, due to the latest AS5 performance complaints on the jboss-dev ml.
Due to his results - AbstractMetaDataContext::getComponentMetaDataRetrieval is the biggest hotspot -, I've decided to add caching impls that are part of MDR already, and will work in bootstrap as well.

Marko's results on artificial app (100 EJBs, 100 @Local,  100 jsp):

  | 21%
  |  org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(Signature) (The method calls itself recursively)
  |   org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(Signature)
  |    org.jboss.aop.Advisor.hasJoinPointAnnotation(Class, Signature, String)
  |     org.jboss.aop.Advisor.hasAnnotation(long, Method, String, Class)
  |      org.jboss.aop.Advisor.hasAnnotation(Method, String)
  |       org.jboss.aop.pointcut.MethodMatcher.classMatchesAll(ClassExpression)
  | 
  |       org.jboss.aop.pointcut.MethodMatcher.matchesIdentifier(ASTMethod)
  |        org.jboss.aop.pointcut.MethodMatcher.matches(ASTMethod)
  |  
  | 16%
  |  java.lang.reflect.Method.toString()
  |   org.jboss.aop.metadata.MethodMetaData.getMethodMetaData(Method)
  |    org.jboss.aop.metadata.MethodMetaData.hasTag(Method, String)
  |     org.jboss.aop.pointcut.MethodMatcher.classMatchesAll(ClassExpression)
  |      org.jboss.aop.pointcut.MethodMatcher.visit(ASTAll, Object)
  |       org.jboss.aop.pointcut.ast.ASTAll.jjtAccept(PointcutExpressionParserVisitor, Object)
  |     org.jboss.aop.pointcut.MethodMatcher.matchesIdentifier(ASTMethod)
  |      org.jboss.aop.pointcut.MethodMatcher.matches(ASTMethod)
  |       org.jboss.aop.pointcut.MethodMatcher.visit(ASTMethod, Object)
  | 
  | 10%
  |  java.util.regex.Pattern$CharProperty.match(Matcher, int, CharSequence)
  |   java.util.regex.Pattern$Curly.match0(Matcher, int, int, CharSequence)
  |    java.util.regex.Pattern$Curly.match(Matcher, int, CharSequence)
  |     java.util.regex.Matcher.match(int, int)
  |      java.util.regex.Matcher.matches()
  |       org.jboss.aop.pointcut.ast.ClassExpression.matches(String)
  |        org.jboss.aop.pointcut.Util.matchesClassExpr(ClassExpression, Class, Advisor)
  |         org.jboss.aop.pointcut.MethodMatcher.matchesClass(ASTMethod)
  |         org.jboss.aop.pointcut.FieldMatcher.visit(ASTField, Object)
  | 
  | 9%
  |  java.lang.Class.getMethod0(String, Class[])
  |   java.lang.Class.getMethod(String, Class[])
  |    org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader.getComponentMetaDataRetrieval(Signature)
  |     org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(Signature)
  |      org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(Signature)
  |       org.jboss.aop.Advisor.hasJoinPointAnnotation(Class, Signature, String)
  |        org.jboss.aop.Advisor.hasAnnotation(long, Method, String, Class)
  |         org.jboss.aop.Advisor.hasAnnotation(Method, String)
  |          org.jboss.aop.pointcut.MethodMatcher.classMatchesAll(ClassExpression)
  |          org.jboss.aop.pointcut.MethodMatcher.matchesIdentifier(ASTMethod)
  | 
  | 8%
  |  org.jboss.aop.pointcut.MatcherStrategy.subtypeOf(Class, ClassExpression, Advisor) (The method calls itself recursively)
  |   org.jboss.aop.pointcut.Util.subtypeOf(Class, ClassExpression, Advisor)
  |    org.jboss.aop.pointcut.Util.matchesClassExpr(ClassExpression, Class, Advisor)
  |     org.jboss.aop.pointcut.MethodMatcher.matchesClass(ASTMethod)
  |      org.jboss.aop.pointcut.MethodMatcher.matches(ASTMethod)
  |       org.jboss.aop.pointcut.MethodMatcher.visit(ASTMethod, Object)
  |        org.jboss.aop.pointcut.ast.ASTMethod.jjtAccept(PointcutExpressionParserVisitor, Object)
  |         org.jboss.aop.pointcut.ExecutionMethodMatcher.visit(ASTExecution, Object)
  |          org.jboss.aop.pointcut.ast.ASTExecution.jjtAccept(PointcutExpressionParserVisitor, Object)
  |           org.jboss.aop.pointcut.MatcherHelper.visit(ASTStart, Object)
  |            org.jboss.aop.pointcut.MatcherHelper.matches()
  |             org.jboss.aop.pointcut.PointcutExpression.matchesExecution(Advisor, Method)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163212#4163212

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163212



More information about the jboss-dev-forums mailing list