You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org> on 2012/03/03 16:59:57 UTC

[jira] [Resolved] (MYFACES-3484) [perf] Use solr ConcurrentLRUCache instead Collections.synchronizedMap

     [ https://issues.apache.org/jira/browse/MYFACES-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3484.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.7
                   2.0.13
    
> [perf] Use solr ConcurrentLRUCache instead  Collections.synchronizedMap
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-3484
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3484
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.13, 2.1.7
>
>
> Some tests shows that use Collections.synchronizedMap for create a LRU cache cause some contention.
> We have 3 places susceptibles for this optimization:
> - org.apache.myfaces.shared.resource.ResourceHandlerCache
> - org.apache.myfaces.shared.application.DefaultViewHandlerSupport
> - org.apache.myfaces.lifecycle.DefaultRestoreViewSupport
> Instead use Collections.synchronizedMap, we can use solr org.apache.solr.util.ConcurrentLRUCache.  For example:
> _checkedViewIdMap = new ConcurrentLRUCache<String, Boolean>((maxSize * 4 + 3) / 3, maxSize);
> We set the lower mark on maxSize and the upper mark at 1.33 maxSize. Solr implementation is very good for these cases. In typical situations, user will set maxSize to a value that prevents cache cleanup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira