{"id":15439556,"url":"https://github.com/ben-manes/concurrentlinkedhashmap","last_synced_at":"2025-04-05T10:09:14.217Z","repository":{"id":28579176,"uuid":"32097112","full_name":"ben-manes/concurrentlinkedhashmap","owner":"ben-manes","description":"A ConcurrentLinkedHashMap for Java","archived":false,"fork":false,"pushed_at":"2020-10-01T19:03:55.000Z","size":55744,"stargazers_count":471,"open_issues_count":1,"forks_count":113,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-10-18T11:24:43.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben-manes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-12T19:19:32.000Z","updated_at":"2024-10-14T22:43:05.000Z","dependencies_parsed_at":"2022-09-03T16:12:35.447Z","dependency_job_id":null,"html_url":"https://github.com/ben-manes/concurrentlinkedhashmap","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-manes%2Fconcurrentlinkedhashmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-manes%2Fconcurrentlinkedhashmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-manes%2Fconcurrentlinkedhashmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-manes%2Fconcurrentlinkedhashmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben-manes","download_url":"https://codeload.github.com/ben-manes/concurrentlinkedhashmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318745,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T19:07:32.166Z","updated_at":"2025-04-05T10:09:14.196Z","avatar_url":"https://github.com/ben-manes.png","language":"Java","funding_links":[],"categories":["并发编程"],"sub_categories":[],"readme":"[Caffeine](https://github.com/ben-manes/caffeine) is the Java 8 successor to ConcurrentLinkedHashMap and Guava's cache. Projects should\nprefer Caffeine and migrate when requiring JDK8 or higher. The previous caching projects are supported in maintenance mode.\n\n***\nA high performance version of [java.util.LinkedHashMap](http://java.sun.com/javase/6/docs/api/java/util/LinkedHashMap.html) for use as a \nsoftware cache. The project was migrated from its [old website](https://code.google.com/p/concurrentlinkedhashmap/) on Google Code.\n\n# Design #\n  * A linked list runs through a [ConcurrentHashMap](http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html) to \nprovide eviction ordering.\n  * Avoids lock contention by amortizing the penalty under lock.\n\nSee the [design document](https://github.com/ben-manes/concurrentlinkedhashmap/wiki/Design) and the StrangeLoop conference \n[slides](http://concurrentlinkedhashmap.googlecode.com/files/ConcurrentCachingAtGoogle.pdf) ([Concurrent Caching at \nGoogle](https://thestrangeloop.com/sessions/concurrent-caching-with-mapmaker)).\n\n# Features #\n  * LRU page replacement policy (currently being upgraded to LIRS).\n  * Equivalent performance to [ConcurrentHashMap](http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html) under \nload.\n  * Can bound by the size of the values (e.g. Multimap cache).\n  * Can notify a listener when an entry is evicted.\n\nSee the [tutorial](https://github.com/ben-manes/concurrentlinkedhashmap/wiki/ExampleUsage) for examples of using this library.\n\n# Status #\n  * **Released v1.4.2** with _Least-Recently-Used_ page replacement policy.\n  * Integrated into [Google Guava](http://code.google.com/p/guava-libraries/) \n([MapMaker](http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html), \n[CacheBuilder](http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/cache/CacheBuilder.html))\n\nSee the [Changelog](https://github.com/ben-manes/concurrentlinkedhashmap/wiki/Changelog) for version history.\n\n## Future ##\n\n  * v2.x: Implement [Low Inter-reference Recency Set](http://www.cse.ohio-state.edu/hpcs/WWW/HTML/publications/abs02-6.html) page replacement \npolicy.\n\n  * [Caffeine](https://github.com/ben-manes/caffeine): A Java 8 rewrite of Guava Cache is the current focus for further development.\n\nSee the [Changelog](https://github.com/ben-manes/concurrentlinkedhashmap/wiki/Changelog) for more details and current progress.\n\n## Maven ##\nMaven users should choose one of the dependencies based on their JDK version.\n\n```\n\u003c!-- JDK 6 --\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.googlecode.concurrentlinkedhashmap\u003c/groupId\u003e\n  \u003cartifactId\u003econcurrentlinkedhashmap-lru\u003c/artifactId\u003e\n  \u003cversion\u003e1.4.2\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003c!-- JDK 5 --\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.googlecode.concurrentlinkedhashmap\u003c/groupId\u003e\n  \u003cartifactId\u003econcurrentlinkedhashmap-lru\u003c/artifactId\u003e\n  \u003cversion\u003e1.2_jdk5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# Performance #\nIn this benchmark an unbounded [ConcurrentHashMap](http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html) is \ncompared to a \n[ConcurrentLinkedHashMap](http://concurrentlinkedhashmap.googlecode.com/svn/wiki/release-1.3.1-LRU/com/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap.html) \nv1.0 with a maximum size of 5,000 entries under an artificially high load (250 threads, 4-cores).\n\n![get](https://raw.githubusercontent.com/ben-manes/concurrentlinkedhashmap/wiki/images/performance/get.png)\n\n![put](https://raw.githubusercontent.com/ben-manes/concurrentlinkedhashmap/wiki/images/performance/put.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-manes%2Fconcurrentlinkedhashmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben-manes%2Fconcurrentlinkedhashmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-manes%2Fconcurrentlinkedhashmap/lists"}