Hi all,
First of all let me say that I've finally taken the
time to test JCS and I really like it, it seems to be
a very powerful system !
First question :
----------------
I did a few performance tests to compare it with the
performance of a regular Hashtable or HashMap, and
basically in the regular scenario the performance with
a Memory LRU are really good.
However I got some pretty bad results when doing a
JCS.get(key) on a key that wasn't in the cache.
Basically what I'm doing is this :
String objectKey = "prout";
String objectValue = "prout";
String otherObjectKey = "prout2";
Date startDate = new Date();
myCache.put(objectKey,objectValue);
for (int i=0; i < TOTAL_LOOPS; i++) {
String myString = (String)
myCache.get(objectKey);
String myString2 = (String)
myJCS.get(otherObjectKey);
}
For a TOTAL_LOOPS value of 100'000 I get the following
results :
JCS Test-----------------------------
Time to execute 100000 loops : 7328ms
Time per loop : 0.07328ms
Hashtable Test-----------------------
Time to execute 100000 loops : 31ms
Time per loop : 3.1E-4ms
HashMap Test-------------------------
Time to execute 100000 loops : 31ms
Time per loop : 3.1E-4ms
If I remove the second lookup (the myString2 which
returned null) I get the following results :
JCS Test-----------------------------
Time to execute 100000 loops : 125ms
Time per loop : 0.00125ms
Hashtable Test-----------------------
Time to execute 100000 loops : 47ms
Time per loop : 4.7E-4ms
HashMap Test-------------------------
Time to execute 100000 loops : 16ms
Time per loop : 1.6E-4ms
Just for info my configuration is the following :
- JDK 1.4.1
- Windows XP Pro SP 1
- Dell Dimension 8200 with P4 1.6, 256MB RAM
Here is the configuration file I used for JCS :
jcs.default=
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=10000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
So here is finally my question : what is causing the
long lookup times in this case ? Are we looking into
some auxiliary cache despite the fact that I haven't
configured any ? Can this time be improved ?
Second question :
-----------------
Ok this is much easier. If I want to make stats about
the currently used regions and their states can I use
CompositeCacheManager or will this interface become
private, but in this case we might have to add
something in JCS such as getRegionNames or something.
Same thing for caches themselves, is there a way to
retrieve a list/vector/enumeration/iterator of all the
cache keys ?
I'm sorry for the long post, but I'm very seriously
considering JCS as it looks great, but I want to make
sure I understand what can/cannot be done with it.
Regards,
Serge Huber.
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
--
To unsubscribe, e-mail: <mailto:turbine-jcs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-jcs-user-help@;jakarta.apache.org>