3 Replies Latest reply on Nov 1, 2007 1:13 PM by Manik Surtani

    Improved performance

    Fredrik Johansson Newbie

      We have been load testing our system lately and we have been noticing many threads waiting to lock the readOwnerList in the LockMap class.

      The readOwnerList_ is a CopyOnWriteArraySet and (as the sourcecode comment above clearly states) is not the most effecient implementation to use here.

      So I decided to try and replace the CopyOnWriteArraySet with a ConcurrentHashMap implementation instead and I got a very significant performance boost. Not only was CPU significantly lower on the machines running the cache, but concurrency was also much, much better. I was actually surprised to see how much performance was gained.

      Therefore, I would certainly recommend that you swap out the CopyOnWriteArraySet to something more efficient. The actual coding took me about 1 minute to do, so it should certainly be a simple way to improve the cache throughput.