[Opensource] SEC: UNCLASSIFIED - RE: Urgent Help!
Horrendous Expresso DBObject per formance problem.
Michael Rimov
rimovm at centercomp.com
Fri Apr 4 11:59:17 PST 2003
At 08:35 AM 4/4/2003 +1000, you wrote:
>Thanks to all for this, I will try a custom cache, that should (hopefully :)
>get rid of the problem entirely.
I recommend the Maps:
EDU.oswego.dl.concurrent.ConcurrentReaderHashMap
or
org.apache.commons.collections.LRUMap
As the best data structures to consider. LRUMap must have synchronized
access, but removes 'stale unused' objects... on the flip side,
ConcurrentReaderHashMap, you must manually remove stale objects, but you
don't need to synchonize access (it's already done for you), and access to
it is amazingly fast in comparison to synchronization.
>Out of curiosity, does anyone know what expresso is doing when retrieving a
>cached record that could be taking so long?
Like I mentioned in my previous email, my first guess would be the fact
that when an object is retrieved from the cache, it is copied so different
temp modifications don't corrupt the cache. I've stressed the 5.0.3
CacheManager fairly thoroughly and I don't believe that the performance hit
would be in there, so if you could profile, I'd be checking
DBObject.retrieveFromCache()
As folks know around here, I'm always interested in tweaking performance to
higher levels, so if you find a good workaround, post it and we'll include
it in future releases.
HTH,
-Mike
More information about the Opensource
mailing list