• Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Labels:
    • Last commented by a user?:
    • Sprint:


      Caffeine is a Java 8 rewrite of Guava's cache to provide significantly higher performance and a near optimal hit rate. Previously I co-authored Guava's Cache and ConcurrentLinkedHashMap (used by Cassandra, etc).

      Caffeine's policy takes into account both the recency and frequency in O(1) time, retaining the popularity history by using a compact sketch. The concurrent throughput scales linearly (tested with 32-core) at 33% of an unbounded Java 8 `ConcurrentHashMap`. The implementation passes Guava's test suite, JSR166's TCK, and its own (consisting of over 1M test execution variants). There is about 95% code coverage and is well documented.

      In comparison, Ehcache has poor performance and in v3 the hit rate was dramatically reduced. Instead of taking a random sample, an MRU heavy distribution is sampled and then the priority strategy (LRU, etc) is applied. This leads to very a poor hit rate for small caches, raising to a random policy's hit rate for large caches. Infinispan is much better in regards to efficiency, but with even worse concurrent performance due to being optimized for cache misses (not hits).

      If there is interest, I'd like to contribute a module with some guidance on how to implement it.


          Issue links



              • Votes:
                7 Vote for this issue
                9 Start watching this issue


                • Created: