| Short Description: | Cache4j is a cache for Java objects with a simple API and fast implementation. It features in-memory caching, a design for a multi-threaded environment, both synchronized and blocking implementations, a choice of eviction algorithms (LFU, LRU, FIFO), and the choice of either hard or soft references for object storage. |
| Description: | Cache4j features are:
- Two implementation: synchronized, blocking.
- In memory caching.
- Eviction algorithm LFU, LRU, FIFO.
- Design for multithread environment.
- Available under the BSD license.
- For store object can use strong or soft reference.
Cache4j performance tester package for testing java caching API.
Testing libraries
- Jcs-1.2.7.0 : Turbine is a servlet based framework that allows experienced Java developers to quickly build web applications. Turbine allows us to use personalize the web sites and to use user logins to restrict access to parts of our application.
- Cache4j_0.4
- Oscache-2.2 : OSCache is a caching solution that includes a JSP tag library and set of classes to perform fine grained dynamic caching of JSP content, servlet responses or arbitrary objects. It provides both in memory and persistent on disk caches, and can allow your site to have graceful error tolerance
- Ehcache-1.1 : Ehcache is a widely used java distributed cache for general purpose caching, Java EE and light-weight containers. It features memory and disk stores, replicate by copy and invalidate, listeners, cache loaders, cache extensions, cache exception handlers, a gzip caching servlet filter, RESTful & SOAP APIs, an implementation of JSR107 and much more. Ehcache is available under an Apache open source license and is actively developed, maintained and supported.
The tests for all caches:
- Eviction algorithm : lru
- Maximum objects count : 1000
- Only memory objects
- Time to live : infinitely
Data for testing: Randomized array of integer, array length 2000.Before testing cache fill from this array. In this package release next tests:
- 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
- Get - get object from cache
All tests perform 1000000 iteration. Cache4j supports JDK 1.4, 1.5 at runtime. If we want to add test then we will do the following things:
- Implement interface net.sf.cache4j.perfomance.ITest
- Write full class name in file \src\classes\net\sf\cache4j\perfomance\test.txt
- Rebuild and run.
If we want test other caching API then we will do the following things :
- Implement interface net.sf.cache4j.perfomance.ICache
- Write full class name in file \src\classes\net\sf\cache4j\perfomance\cache.txt
- Rebuild and run.
|