[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2093) Optimize getting Id in Seam code for better performance

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Tue Aug 4 00:00:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12478712#action_12478712 ] 

Stuart Douglas commented on JBSEAM-2093:
----------------------------------------

I can't imagine that shaving millions of a second off calls that are only made a couple of times per page view ranks very high on the priority list. This is not an issue that would have any measurable effect on performance. 


> Optimize getting Id in Seam code for better performance
> -------------------------------------------------------
>
>                 Key: JBSEAM-2093
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-2093
>             Project: Seam
>          Issue Type: Feature Request
>          Components: Performance and Scalability
>            Reporter: Mikhail Grushinskiy
>            Assignee: Shane Bryzak
>            Priority: Minor
>             Fix For: 2.1.1.CR1
>
>         Attachments: AnnotationsTest.java
>
>
> This sequence of calls (used in PersistenceProvider) is quite slow
> Entity.forClass(bean.getClass()).getIdentifier(bean);
> 	
> 1) Entity.forClass() is reading annotations using JDK 5 methods (JDK 5 annotation reading is not that fast). Can it be cached?
> 2) JDK 5 reflection is used to get bean id (which is slower than optmized reflection with cglib)
> 3) There could be other reasons as well. I think repetitive calling of this sequence under profiler will give better picture.
> from PersistenceProvider.java
>    /**
>     * Get the value of the entity identifier attribute.
>     * 
>     * @param bean a managed entity instance
>     */
>    public Object getId(Object bean, EntityManager entityManager)
>    {
>       return Entity.forClass( bean.getClass() ).getIdentifier(bean);
>    }
>    
>    /**
>     * Get the name of the entity
>     * 
>     * @param bean
>     * @param entityManager
>     */
>    public String getName(Object bean, EntityManager entityManager)
>    {
>       return Entity.forClass(bean.getClass()).getName();
>    }
>    
>    /**
>     * Get the value of the entity version attribute.
>     * 
>     * @param bean a managed entity instance
>     */
>    public Object getVersion(Object bean, EntityManager entityManager)
>    {
>       return Entity.forClass( bean.getClass() ).getVersion(bean);
>    }

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

        


More information about the seam-issues mailing list