[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1966) Code optimization in Component class

Yannick Lazzari (JIRA) jira-events at lists.jboss.org
Tue Sep 25 09:04:40 EDT 2007


Code optimization in Component class
------------------------------------

                 Key: JBSEAM-1966
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1966
             Project: JBoss Seam
          Issue Type: Feature Request
            Reporter: Yannick Lazzari
            Priority: Minor


During the execution of one JSF request, I noticed a lot of calls to the org.jboss.seam.Component.hasAnnotation method. Couldn't this information be cached somewhere? I know the reflection API is quite fast but in this particular context, couldn't all the "metadata" of a component be stored as class members of the Component class? I know some if already is but I found something that could be added. In the org.jboss.seam.contexts.ServerConversationContext class, the following method seems to be called hundreds of times per request:

Code:

private boolean isPerNestedConversation(String name)  {
	Component component = Component.forName(name);
	return (component != null) && component.beanClassHasAnnotation(PerNestedConversation.class);
}
	



Could't a "perNestedConversation" class member be added on the org.jboss.seam.Component class and initialized when initializing the component instead of looking for the annotation every time? This is just one example. I haven't looked everywhere where the org.jboss.seam.Component.hasAnnotation is called but perhaps similar optimizations could be done elsewhere. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list