Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A ConcurrentLinkedHashMap for Java

License

NotificationsYou must be signed in to change notification settings

ben-manes/concurrentlinkedhashmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Design

  • 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).

Features

  • 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.

Status

See theChangelog for version history.

Future

See theChangelog for more details and current progress.

Maven

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>

Performance

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).

get

put

About

A ConcurrentLinkedHashMap for Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp