directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: [Mavibot] Need for a cache to replace the WeakReferences...
Date Tue, 26 May 2015 02:39:01 GMT
Le 26/05/15 01:11, Benjamin Manes a écrit :
> I stumbled upon an old thread [1] regarding Mavibot's cache experiments. In
> that thread the project was moving away from weak reference based caching
> and had poor performance with Ehcache. A follow up discussion [2] mentioned
> experimenting with ConcurrentLinkedHashMap (my old project), but drops off
> before describing the results. As it appears Ehcache is used, it is not
> clear whether the performance problems were resolved or deemed not fixable.
FTR, we used ehcahce because it was way faster than the system we
implemented, which was based on weak-references. The reason was that we
were already using ehcache in ApacheDS, so it was easy for us to switch
to this system..
>
> In case there is still a bottleneck in the caching layer you may be
> interested in my Java 8 caching project, Caffeine [3]. My benchmarks show
> it to be 7x faster 
7x faster than?

> on a 4-core machine and should scale better as the CPU
> count increases.

My question :
- it seems like cafeine is using weak-references ( keys automatically
wrapped in weak references
<https://github.com/ben-manes/caffeine/wiki/Eviction#reference-based>).
The issue we had when we were using weak-references is that it was
painfully slow when we were exhausting the memory, because the GC
behaviour was really, really bad.
- do you have comparison between caffeine and ehcache ?

In any case, be sure we want to replace ehcache -which is a bit heavy)
by something lighter in the near future, we will certainly experiment
caffeine !

Thanks !


Mime
View raw message