jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject RE: Initial performance test results: JCS is almost twice as fast as EHCache at gets and puts
Date Thu, 16 Feb 2006 19:24:59 GMT
It is very difficult to compare the ehcache disk store
and the JCS Indexed Disk Cache.

The JCS version is much more sophisticated.  

JCS puts items into a queue called purgatory.  While
they are in this queue, they are still accessible. 
This queue gets worked when items are in it.  The
number of threads used in the system as a whole for
disk caches is configurable using the thread pool
configuration options in JCS.  I could have 1000
regions and only use 3 threads to work the disk
queues.  From what I can tell EH will use 1 thread per
region.  This is worse than the JCS default, which
uses a queue that kills its threads when they are not
used. . . . and much worse than using JCS with a
thread pool.

The size of JCS purgatory is configurable, so you can
avoid catastrophe if something goes wrong with the
queue worker.  EH doesn't have any such safety.  

JCS limits the number of keys that can be kept for the
disk cache.  EH cannot do this.

The ehcache disk version is very simple.  It puts an
unlimited number of items in a temporary store.  You
can easily fill this up and run out of memory.  You
can put items into JCS prugatory faster than they can
be gc's but it is much more difficult.  The EH store
is then flushed to disk every 200ms.  While EH is
flushing the entire disk cache blocks!  JCS disk cache
is based on a continuous spooling model, not a stop
the world model like EH.  In most cases the EH model
will work out, but not if you put a lot of big items
on disk at once.

The EH disk store also seems to just keep growing. 
After several tests, the size of the data file was 10
times that of JCS and EH was taking 10 times as long. 


You can saturate the EH version much more quickly,
since it will hold as many items as you can put in in
200 ms.

I tried with 100k and JCS could handle it, but EH died
with an out of memory exception.

2006-02-16 13:47:04,166 [main] WARN 
net.sf.ehcache.config.ConfigurationFactory - No
configuration found. Configuring ehcache from
ehcache-failsafe.xml  found in the classpath:
jar:file:/C:/Documents%20and%20Settings/sg0894751/.maven/repository/ehcache/jars/ehcache-1.2beta4.jar!/ehcache-failsafe.xml
2006-02-16 13:47:04,446 [main] WARN 
org.apache.jcs.auxiliary.disk.indexed.IndexedDisk -
Resetting data file
JCS       put time for 100000 = 5084; millis per =
0.05084
JCS       get time for 100000 = 47368; millis per =
0.47368
Starting run for EHCache  
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError


EH cache developed its disk store in response to a bug
in the JCS version.  This bug was fixed a few years
ago . . .  The nice thing about JCS is that it is
completely pluggable.  It would take about 30 minutes
to plug a differnt disk cache implementation into JCS
if you so pleased . . . .  

Aaron



--- "Lane, Brad" <Brad.Lane@pearson.com> wrote:

> I ran similar tests a couple months ago and came up
> with the exact opposite
> result. I also ran tests using disk cache and
> EHCache was significantly
> faster. 
> 
> -----Original Message-----
> From: Alistair Forbes
> [mailto:forbes.al@googlemail.com] 
> Sent: Thursday, February 16, 2006 2:11 AM
> To: JCS Users List
> Subject: Re: Initial performance test results: JCS
> is almost twice as fast
> as EHCache at gets and puts
> 
> That is good news. Just for interest, which JVM
> version are you using?
> 
> On 2/16/06, Aaron Smuts <asmuts@yahoo.com> wrote:
> >
> > I just built both EHCache and JCS from head,
> configured both similarly 
> > and ran multiple put / get rounds of 50,000.  JCS,
> using the default 
> > LRU Memory Cache, was nearly twice as fast as
> EHCache in multiple 
> > trials for both puts and gets.  I have the log
> levels for both set at 
> > info.  I would like to verify my results, since
> they completely 
> > contradict the information on the EHCache site. 
> From what I can tell 
> > so far, JCS is significantly faster than EHCache.
> >
> > Since, neither will be a relevant bottleneck, it
> may be beside the 
> > point. . . .  I will run more tests to confirm.
> >
> > Here is the data:
> >
> > JCS       put time for 50000 = 651; millis per =
> > 0.01302
> > JCS       get time for 50000 = 160; millis per =
> > 0.0032
> > EHCache   put time for 50000 = 481; millis per =
> > 0.00962
> > EHCache   get time for 50000 = 110; millis per =
> > 0.0022
> >
> >
> > JCS       put time for 50000 = 240; millis per =
> > 0.0048
> > JCS       get time for 50000 = 90; millis per =
> 0.0018
> > EHCache   put time for 50000 = 491; millis per =
> > 0.00982
> > EHCache   get time for 50000 = 120; millis per =
> > 0.0024
> >
> >
> > JCS       put time for 50000 = 241; millis per =
> > 0.00482
> > JCS       get time for 50000 = 80; millis per =
> 0.0016
> > EHCache   put time for 50000 = 551; millis per =
> > 0.01102
> > EHCache   get time for 50000 = 110; millis per =
> > 0.0022
> >
> >
> > JCS       put time for 50000 = 240; millis per =
> > 0.0048
> > JCS       get time for 50000 = 90; millis per =
> 0.0018
> > EHCache   put time for 50000 = 481; millis per =
> > 0.00962
> > EHCache   get time for 50000 = 130; millis per =
> > 0.0026
> >
> >
> > JCS       put time for 50000 = 230; millis per =
> > 0.0046
> > JCS       get time for 50000 = 181; millis per =
> > 0.00362
> > EHCache   put time for 50000 = 520; millis per =
> > 0.0104
> > EHCache   get time for 50000 = 101; millis per =
> > 0.00202
> >
> >
> > JCS       put time for 50000 = 220; millis per =
> > 0.0044
> > JCS       get time for 50000 = 90; millis per =
> 0.0018
> > EHCache   put time for 50000 = 641; millis per =
> > 0.01282
> > EHCache   get time for 50000 = 110; millis per =
> > 0.0022
> >
> >
> > JCS       put time for 50000 = 250; millis per =
> > 0.0050
> > JCS       get time for 50000 = 121; millis per =
> > 0.00242
> > EHCache   put time for 50000 = 590; millis per =
> > 0.0118
> > EHCache   get time for 50000 = 101; millis per =
> > 0.00202
> >
> >
> > JCS       put time for 50000 = 260; millis per =
> > 0.0052
> > JCS       get time for 50000 = 100; millis per =
> > 0.0020
> > EHCache   put time for 50000 = 581; millis per =
> > 0.01162
> > EHCache   get time for 50000 = 100; millis per =
> > 0.0020
> >
> >
> > JCS       put time for 50000 = 290; millis per =
> > 0.0058
> > JCS       get time for 50000 = 121; millis per =
> > 0.00242
> > EHCache   put time for 50000 = 570; millis per =
> > 0.0114
> > EHCache   get time for 50000 = 121; millis per =
> > 0.00242
> >
> >
> > JCS       put time for 50000 = 210; millis per =
> > 0.0042
> > JCS       get time for 50000 = 120; millis per =
> > 0.0024
> > EHCache   put time for 50000 = 561; millis per =
> > 0.01122
> > EHCache   get time for 50000 = 130; millis per =
> > 0.0026
> >
> >
> > JCS       put time for 50000 = 250; millis per =
> > 0.0050
> > JCS       get time for 50000 = 151; millis per =
> > 0.00302
> > EHCache   put time for 50000 = 560; millis per =
> > 0.0112
> > EHCache   get time for 50000 = 111; millis per =
> > 0.00222
> >
> >
> > JCS       put time for 50000 = 250; millis per =
> > 0.0050
> > JCS       get time for 50000 = 100; millis per =
> > 0.0020
> > EHCache   put time for 50000 = 711; millis per =
> > 0.01422
> > EHCache   get time for 50000 = 100; millis per =
> > 0.0020
> >
> >
> > JCS       put time for 50000 = 251; millis per =
> > 0.00502
> > JCS       get time for 50000 = 90; millis per =
> 0.0018
> > EHCache   put time for 50000 = 511; millis per =
> > 0.01022
> > EHCache   get time for 50000 = 90; millis per =
> 0.0018
> >
> >
> > JCS       put time for 50000 = 220; millis per =
> > 0.0044
> > JCS       get time for 50000 = 100; millis per =
> > 0.0020
> > EHCache   put time for 50000 = 491; millis per =
> > 0.00982
> > EHCache   get time for 50000 = 90; millis per =
> 0.0018
> >
> >
> > JCS       put time for 50000 = 230; millis per =
> > 0.0046
> > JCS       get time for 50000 = 80; millis per =
> 0.0016
> > EHCache   put time for 50000 = 201; millis per =
> > 0.00402
> > EHCache   get time for 50000 = 390; millis per =
> > 0.0078
> >
> >
> > JCS       put time for 50000 = 201; millis per =
> > 0.00402
> > JCS       get time for 50000 = 120; millis per =
> > 0.0024
> > EHCache   put time for 50000 = 180; millis per =
> > 0.0036
> > EHCache   get time for 50000 = 411; millis per =
> > 0.00822
> >
> >
> > JCS       put time for 50000 = 210; millis per =
> 
=== message truncated ===


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message