lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Engels" <reng...@ix.netcom.com>
Subject RE: NioFile cache performance
Date Thu, 08 Dec 2005 20:50:00 GMT
I modified MemoryLRUCache to use the attached ConcurrentHashMap.java and ran
under 1.4.2_10
filesize is 4194304

non-cached time = 11140, avg = 0.01114

non-cached threaded (3 threads) time = 35485, avg = 0.011828333333333333

cached time = 6109, avg = 0.006109

cache hits 996138

cache misses 3862

cached threaded (3 threads) time = 17281, avg = 0.0057603333333333335

cache hits 3985911

cache misses 14089

with the shared test

filesize is 4194304
non-cached time = 11266, avg = 0.011266

non-cached threaded (3 threads) time = 46734, avg = 0.015578

cached time = 6094, avg = 0.006094

cache hits 996133

cache misses 3867

cached threaded (3 threads) time = 16500, avg = 0.0055

cache hits 3994999

cache misses 5001

I then ran the tests using jdk 1.5.0_06 using the built-in ConcurrentHashMap
filesize is 4194304

non-cached time = 10515, avg = 0.010515

non-cached threaded (3 threads) time = 30688, avg = 0.010229333333333333

cached time = 7031, avg = 0.007031

cache hits 996742

cache misses 3258

cached threaded (3 threads) time = 17468, avg = 0.005822666666666667

cache hits 3989122

cache misses 10878

with the shared test

filesize is 4194304
non-cached time = 10187, avg = 0.010187

non-cached threaded (3 threads) time = 44000, avg = 0.014666666666666666

cached time = 6234, avg = 0.006234

cache hits 996315

cache misses 3685

cached threaded (3 threads) time = 16766, avg = 0.005588666666666666

cache hits 3995081

cache misses 4919

surprisingly the 1.4.2_10 version performed as well (if not better) than the
jdk 1.5 version.

Also, I am only running on a single processor box (non-hyper threaded), so
it would be interesting to see the numbers on a true multi-processor box. My
thinking is that the cached version will be MUCH faster than the non, as
many more context switches into the OS will be avoided.
  -----Original Message-----
  From: Paul Smith [mailto:psmith@aconex.com]
  Sent: Thursday, December 08, 2005 1:54 PM
  To: java-dev@lucene.apache.org
  Subject: Re: NioFile cache performance


    Most of the CPU time is actually used during the synchronization with
multiple threads. I hacked together a version of MemoryLRUCache that used a
ConcurrentHashMap from JDK 1.5, and it was another 50% faster ! At a
minimum, if the ReadWriteLock class was modified to use the 1.5 facilities
some significant additional performance gains should be realized.


  Would you be able to run the same test in JDK 1.4 but use the
util.concurrent compatibility pack? (supposedly the same classes in Java5)
It would be nice to verify whether the gain is the result of the different
ConcurrentHashMap vs the different JDK itself.


  Paul Smith

Mime
View raw message