Home Help Center

Synchronized EvictorBase

blairblair Member Blair ZajacOrganization: Sony Pictures ImageworksProject: VnP ✭✭
The sample Java EvictorBase is synchronized. I'm wondering if anybody has done any measurements to see what kind of performance impact this has and at what levels of RPCs/sec does it matter?

I'm looking at using the java.util.concurrent.ConcurrentHashMap as shown here to implement a concurrent LRU servant cache:

Concurrency - Concurrent LRUCache?

Before I start writing code, want to know if this will be worth it.

BTW, the above code doesn't use reference counts to not evict servants that are in use, so that would need to be modified.



  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Blair,

    I suspect it depends a lot on how long a cache misses take in your application.

    In C++, the Freeze/customEvictor demo compares the performance of EvictorBase with an evictor implemented using IceUtil::Cache (i.e. with better concurrency). When the database lookups are very fast (e.g all cached in Berkeley DB's in-memory cache), there is no advantage in using IceUtil::Cache.

    Best regards,
Sign In or Register to comment.