资 源 简 介
Super simple local in memory cache using java.util.concurrent package for high performance thread-safe design.
It"s only 75 lines of code including comments and getters. View code
Features
Super simple using only a few constructs from java.util.concurrent package
Supports maximum cache size
Supports item expiration
Getting Started
Very easy:
// Create a new cacheKittyCache cache = new KittyCache(5000); // 5000 is max number of objects// Put an object into the cachecache.put("mykey", value, 500); // 500 is time to live in seconds// Get an object from the cachevalue = cache.get("mykey");
Performance
I"ve only tested again Ehcache, but here"s 3 separate runs, each with max cache size of 10,000 elements and all in memory. All values in ms.