cache4j perfomance tester
Package for testing java caching API
Tested libraries
Tests

For all caches:

  • maximum objects count : 1000
  • eviction algorithm : lru
  • time to live : infinitely
  • only memory objects

Data for testing: Randomized array of integer. Array length 2000. Before testing cache fill from this array.

In this package release next tests:

  • Get - get object from cache
  • GetPutRemove - get object from cache + if object exists then delete + if object not exists then put in cache
  • GetPutRemoveT - get object from cache + if object exists then delete + if object not exists then put in cache + all this operation do 10 threads

All tests perform 1000000 iteration.

Java Requirements
Support JDK 1.4, 1.5 at runtime
Start tests

ant test
or
run.bat
or
run.bat 10 - test each API 10 times

How i can add test ?
  1. Implement interface net.sf.cache4j.perfomance.ITest
  2. Write full class name in file \src\classes\net\sf\cache4j\perfomance\test.txt
  3. Rebuild and run.
How i can test other caching API ?
  1. Implement interface net.sf.cache4j.perfomance.ICache
  2. Write full class name in file \src\classes\net\sf\cache4j\perfomance\cache.txt
  3. Rebuild and run.
Test result (run.bat 10)
---------------------------------------------------------------
java.version=1.4.2_10
java.vm.name=Java HotSpot(TM) Client VM
java.vm.version=1.4.2_10-b03
java.vm.info=mixed mode
java.vm.vendor=Sun Microsystems Inc.
os.name=Windows 2000
os.version=5.0
os.arch=x86
---------------------------------------------------------------
This test can take about 5-10 minutes. Please wait ...
---------------------------------------------------------------
              |GetPutRemoveT  |GetPutRemove   |Get            |
---------------------------------------------------------------
cache4j 0.4   |7672           |8062           |5797           |
cache4j 0.4   |7610           |7953           |5719           |
cache4j 0.4   |7578           |7984           |5688           |
cache4j 0.4   |7594           |7953           |5766           |
cache4j 0.4   |7593           |7954           |5718           |
cache4j 0.4   |7609           |7953           |5641           |
cache4j 0.4   |7625           |8000           |5750           |
cache4j 0.4   |7593           |7937           |5687           |
cache4j 0.4   |7578           |7937           |5703           |
cache4j 0.4   |7610           |8000           |5718           |
oscache 2.2   |38875          |33547          |9015           |
oscache 2.2   |30578          |33547          |8984           |
oscache 2.2   |39296          |33469          |9000           |
oscache 2.2   |39922          |33735          |9110           |
oscache 2.2   |39610          |33844          |9078           |
oscache 2.2   |39234          |33922          |9109           |
oscache 2.2   |39188          |33938          |9157           |
oscache 2.2   |22234          |33969          |9110           |
oscache 2.2   |38563          |33765          |9094           |
oscache 2.2   |39484          |33750          |9063           |
ehcache 1.1   |6625           |6297           |3797           |
ehcache 1.1   |6625           |6281           |3828           |
ehcache 1.1   |6656           |6312           |3828           |
ehcache 1.1   |6610           |6297           |3844           |
ehcache 1.1   |6656           |6281           |3766           |
ehcache 1.1   |6625           |6296           |3844           |
ehcache 1.1   |6640           |6282           |3781           |
ehcache 1.1   |6656           |6297           |3766           |
ehcache 1.1   |6625           |6265           |3813           |
ehcache 1.1   |6625           |6297           |3828           |
jcs 1.2.7.0   |11172          |9844           |5250           |
jcs 1.2.7.0   |11141          |9875           |5219           |
jcs 1.2.7.0   |11047          |9860           |5250           |
jcs 1.2.7.0   |11140          |9860           |5219           |
jcs 1.2.7.0   |11141          |9843           |5234           |
jcs 1.2.7.0   |11110          |9875           |5265           |
jcs 1.2.7.0   |11156          |9875           |5250           |
jcs 1.2.7.0   |11141          |9859           |5234           |
jcs 1.2.7.0   |11125          |9860           |5250           |
jcs 1.2.7.0   |11187          |9859           |5282           |
---------------------------------------------------------------