[
https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16508752#comment-16508752 ]
Ben Manes commented on OFBIZ-6747:
----------------------------------
If you do switch to Caffeine, a few minor notes to be aware of...
# Modifying the maximum size at runtime is now at:
{{Cache.policy().eviction().ifPresent(policy -> policy.setMaximum(newInMemory)}}.
# Caffeine uses [W-TinyLFU|
https://github.com/ben-manes/caffeine/wiki/Efficiency] instead of LRU, which incorporates frequency to provide a much higher hit-rate
# The [overhead|
https://github.com/ben-manes/caffeine/wiki/Benchmarks#read-100-1] of both caches, compared to an unbounded {{ConcurrentHashMap}} is probably not worth optimizing around. Caffeine performs at 33% read throughput and CLHM at 28%. In reality that's more than adequate since micro-benchmarks benefit from hardware cache efficiencies and don't include any application overhead. So in practice one does not observe a penalty given other work involved.
Per your findings, I would think a custom {{Cache}} interface with your methods would be cleaner than {{instanceOf}} checks so as to encapsulate all of the implementation details of a provider.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)