[ 
https://issues.apache.org/jira/browse/WICKET-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793289#action_12793289
 ] 

Ricardo Mayerhofer edited comment on WICKET-2344 at 12/21/09 6:34 PM:
----------------------------------------------------------------------

Hi Juergen,
I upgraded to 1.4.3 expecting a performance improvement, but we still have a 
bottleneck on wicket-spring integration.
What we did was to change equals and hash code to ignore bean name if not 
filled. I think this is ok, considering that if name is null, we're injecting 
by type, so bean name will have no effect for cache purposes.

I'm attaching our profile result based on 1.4.3 and the modified equals/hash 
code. I'm not sure if it's 100% correct but it works.

      was (Author: ricardo.ekm):
    Hi Juergen,
I upgraded to 1.4.3 expecting a performance improvement, but we still have a 
bottleneck on wicket-spring integration.
What we did was to change equals and hash code to ignore bean name if not 
filled. I think this is ok, considering that if name is null, we're injecting 
by type, so the bean name will have no effect for cache purposes.

I'm attaching our profile result based on 1.4.3 and the modified equals/hash 
code. I'm not sure if it's 100% correct but it works.
  
> Performance improvement: more efficient AnnotProxyFieldValueFactory cache
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2344
>                 URL: https://issues.apache.org/jira/browse/WICKET-2344
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-spring
>            Reporter: Arnout Engelen
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4.3, 1.5-M1
>
>         Attachments: profile.JPG, SpringBeanLocator.java
>
>
> AnnotProxyFieldValueFactory holds a cache of proxies for singleton beans. The 
> cache is checked like this:
>   // only check the cache if the bean is a singleton
>   if (locator.isSingletonBean() && cache.containsKey(locator)) {
>     return cache.get(locator);
>   }
> However, when the bean is referenced by type rather than by name (the default 
> and common case), 'locator.isSingletonBean()' is a quite expensive operation, 
> because it looks up the bean name by type (it indirectly calls 
> BeanFactoryUtils.beanNamesForTypeIncludingAncestors()).
> I think the call to locator.isSingletonBean() should either be omitted 
> entirely (the cache only contains singleton proxies anyway), or omitted when 
> annot.name() is blank.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to