[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


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

        

Reply via email to