This forum has been archived. Please start a new discussion on GitHub.

Synchronized EvictorBase

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.



  • bernard
    bernard Jupiter, FL
    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,