- Notifications
You must be signed in to change notification settings - Fork114
A ConcurrentLinkedHashMap for Java
License
ben-manes/concurrentlinkedhashmap
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Caffeine is the Java 8 successor to ConcurrentLinkedHashMap and Guava's cache. Projects shouldprefer Caffeine and migrate when requiring JDK8 or higher. The previous caching projects are supported in maintenance mode.
A high performance version ofjava.util.LinkedHashMap for use as asoftware cache. The project was migrated from itsold website on Google Code.
- A linked list runs through aConcurrentHashMap toprovide eviction ordering.
- Avoids lock contention by amortizing the penalty under lock.
See thedesign document and the StrangeLoop conferenceslides (Concurrent Caching atGoogle).
- LRU page replacement policy (currently being upgraded to LIRS).
- Equivalent performance toConcurrentHashMap underload.
- Can bound by the size of the values (e.g. Multimap cache).
- Can notify a listener when an entry is evicted.
See thetutorial for examples of using this library.
- Released v1.4.2 withLeast-Recently-Used page replacement policy.
- Integrated intoGoogle Guava(MapMaker,CacheBuilder)
See theChangelog for version history.
v2.x: ImplementLow Inter-reference Recency Set page replacementpolicy.
Caffeine: A Java 8 rewrite of Guava Cache is the current focus for further development.
See theChangelog for more details and current progress.
Maven users should choose one of the dependencies based on their JDK version.
<!-- JDK 6 --><dependency> <groupId>com.googlecode.concurrentlinkedhashmap</groupId> <artifactId>concurrentlinkedhashmap-lru</artifactId> <version>1.4.2</version></dependency><!-- JDK 5 --><dependency> <groupId>com.googlecode.concurrentlinkedhashmap</groupId> <artifactId>concurrentlinkedhashmap-lru</artifactId> <version>1.2_jdk5</version></dependency>In this benchmark an unboundedConcurrentHashMap iscompared to aConcurrentLinkedHashMapv1.0 with a maximum size of 5,000 entries under an artificially high load (250 threads, 4-cores).
About
A ConcurrentLinkedHashMap for Java
Resources
License
Uh oh!
There was an error while loading.Please reload this page.

