GithubHelp home page GithubHelp logo

xjtuafds / concurrentlinkedhashmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ben-manes/concurrentlinkedhashmap

0.0 2.0 0.0 54.87 MB

A ConcurrentLinkedHashMap for Java

License: Apache License 2.0

Java 100.00%

concurrentlinkedhashmap's Introduction

A high performance version of java.util.LinkedHashMap for use as a software cache.

Design

  • A linked list runs through a ConcurrentHashMap to provide eviction ordering.
  • Avoids lock contention by amortizing the penalty under lock.

See the design document and the StrangeLoop conference slides (Concurrent Caching at Google).

Features

  • LRU page replacement policy (currently being upgraded to LIRS).
  • Equivalent performance to ConcurrentHashMap under load.
  • Can bound by the size of the values (e.g. Multimap cache).
  • Can notify a listener when an entry is evicted.

See the tutorial for examples of using this library.

Status

See the Changelog for version history.

Future

See the Changelog 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 unbounded ConcurrentHashMap is compared to a ConcurrentLinkedHashMap v1.0 with a maximum size of 5,000 entries under an artificially high load (250 threads, 4-cores).

get

put

concurrentlinkedhashmap's People

Contributors

ben-manes avatar

Watchers

James Cloos avatar bclin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.