[
https://issues.apache.org/jira/browse/CASSANDRA-10855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15056445#comment-15056445
]
Ben Manes commented on CASSANDRA-10855:
---------------------------------------
A little background from private discussions with Jonathan and Robert leading
to this ticket. If the performance analysis is positive then it provides a
strong motivation to integrate W-TinyLFU into OHC. As Robert described it, the
on-heap caches are low hanging fruit where the key cache is performance
critical.
These caching projects have always been on my personal time as a research
hobby. My original interest was on concurrency, since all other caches either
use coarse locking or make sacrifices for throughput (e.g. lower hit rates,
O(n) eviction). More recently I worked on improving hit rates, as described in
that paper. I've tended to keep a narrow focus until solving a particularly
hard problem and off-heap adds more complexity so it wasn't tackled. I'm a
little disappointed that OHC didn't borrow ideas from CLHM, as the fundamentals
are transferable, but perhaps we'll combine them all together in a future
project.
> Use Caffeine (W-TinyLFU) for on-heap caches
> -------------------------------------------
>
> Key: CASSANDRA-10855
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10855
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Ben Manes
> Labels: performance
>
> Cassandra currently uses
> [ConcurrentLinkedHashMap|https://code.google.com/p/concurrentlinkedhashmap]
> for performance critical caches (key, counter) and Guava's cache for
> non-critical (auth, metrics, security). All of these usages have been
> replaced by [Caffeine|https://github.com/ben-manes/caffeine], written by the
> author of the previously mentioned libraries.
> The primary incentive is to switch from LRU policy to W-TinyLFU, which
> provides [near optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency]
> hit rates. It performs particularly well in database and search traces, is
> scan resistant, and as adds a very small time/space overhead to LRU.
> Secondarily, Guava's caches never obtained similar
> [performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks] to CLHM
> due to some optimizations not being ported over. This change results in
> faster reads and not creating garbage as a side-effect.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)