ben-manes/caffeine
View on GitHub ↗ ★ 17,930 Java
A high performance caching library for Java
51 mentions on Hacker News by 19 people: 4 stories, 47 comments · first 2015-02-24 · latest 2025-03-06
20082026
-
…based on Java 8's CHM rewrite, plus many learnings. You might look at its benchmarks for ideas: https://github.com/ben-manes/caffeine/wiki/Benchmarks 5. Data structures are surprisingly tricky. For example see this analysis showing an…
comment by NovaX · 2025-03-06 · in Microbenchmarks: HashMap, ConcurrentHashMap, and Guava Caches -
…adapts automatically between LRU and LFU. The original algorithm is called Windiw TinyLFU (design https://github.com/ben-manes/caffeine/wiki/Design ), see it in action e.g. here: https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by JanecekPetr · 2025-02-03 · in Analyzing the codebase of Caffeine, a high performance caching library -
…with ideas and fix unexpected issues until a correct, simple, elegant design emerges. [1] https://github.com/ben-manes/caffeine/discussions/1744
comment by NovaX · 2025-02-03 · in Analyzing the codebase of Caffeine, a high performance caching library -
…other language ecosystems have been slowly adopting similar ideas in their caching libraries. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency#adapti...
comment by NovaX · 2025-02-02 · in Analyzing the codebase of Caffeine, a high performance caching library -
…is very common, where algorithms differ by how they promote and how/if they adapt the sizes. [1] https://github.com/ben-manes/caffeine/blob/master/simulator/... [2] https://github.com/ben-manes/caffeine/actions/runs/130865965...
comment by NovaX · 2025-02-02 · in Analyzing the codebase of Caffeine, a high performance caching library -
I went through some of the issues to see how aggressively they close them and found this gem: https://github.com/ben-manes/caffeine/issues/1824#issuecomme...
comment by bean-weevil · 2025-02-02 · in Analyzing the codebase of Caffeine, a high performance caching library -
…a batch operation based on a time/space window. Here is how we do it in the Java world. [1] [1] https://github.com/ben-manes/caffeine/tree/master/examples/c...
comment by NovaX · 2024-10-11 · in Show HN: Pocache, preemptive optimistic caching for Go -
…out (unfortunately) and most of them ended up at AWS, working on storage like S3 and Glacier. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency#window ... [2] https://scholar.google.com/citations?user=kWivlnsAAAAJ&hl=en [3]…
comment by donavanm · 2024-10-10 · in Working Set Size Estimation (2018) -
…to see how it compares. [1] https://www.usenix.org/system/files/conference/atc17/atc17-b... [2] https://github.com/ben-manes/caffeine/wiki/Simulator
comment by NovaX · 2024-01-09 · in Why Aren't We Sieve-Ing? -
…to be easily disproven, so I have not implement this policy in Caffeine’s simulator yet. [1]: https://github.com/ben-manes/caffeine/wiki/Simulator [2]: https://github.com/1a1a11a/libCacheSim/discussions/20
comment by NovaX · 2023-12-23 · in Otter, Fastest Go in-memory cache based on S3-FIFO algorithm -
…reviewed and linked from the official S3-FIFO page. https://s3fifo.com A benchmark is as follows. https://github.com/ben-manes/caffeine/wiki/Efficiency I can't deal with you any longer. Over.
comment by falsandtru · 2023-12-23 · in Otter, Fastest Go in-memory cache based on S3-FIFO algorithm -
That, and also when caffeine came out it replaced one of the major uses (caching) of guava. https://github.com/ben-manes/caffeine
comment by shrdlu2 · 2023-11-08 · in Guava: Google core libraries for Java -
…valid points but, when used properly, Caffeine + Reactor can work together really nicely [1]. [1]: https://github.com/ben-manes/caffeine/blob/master/examples/c...
comment by NovaX · 2023-08-19 · in Helidon Níma: A Java microservices framework based on virtual threads -
…while excellent, the implementation logic is not intuitive which makes it frustrating to debug. [1] https://github.com/ben-manes/caffeine/blob/master/simulator/... [2] https://github.com/ben-manes/caffeine/blob/master/simulator/... [3]…
comment by NovaX · 2023-06-25 · in FIFO can be Better than LRU [pdf] -
I wonder why all these papers ignore comparison against W-TinyLFU. https://github.com/ben-manes/caffeine/wiki/Efficiency Shows that it really outperforms ARC as well and they also have an optimal oracle version that they evaluate against…
comment by vlovich123 · 2023-06-23 · in FIFO can be Better than LRU [pdf] -
…don't gather statistics on the demonstration server. I believe that the in-memory caffeine cache ( https://github.com/ben-manes/caffeine ) saved me.
comment by bchapuis · 2023-05-29 · in Apache Baremaps: online maps toolkit -
…of the work behind that policy leads me to believe it could be improved to handle that case. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency#adapti...
comment by NovaX · 2022-08-16 · in DragonFlydb: Cache Design -
Yeah, saves you from thundering herd problems https://github.com/ben-manes/caffeine cache does something similar by caching the future that gets returned on look-ups if the value is still being computed
comment by asadawadia · 2022-07-22 · in Ask HN: What are some cool but obscure data structures you know about? -
And also a (very efficient) Java cache library https://github.com/ben-manes/caffeine
comment by Danidada · 2021-11-16 · in Show HN: Caffeine – Minimum viable back end for prototyping -
…(Java) uses TinyLFU, which "builds upon Bloom filter theory" (from the abstract of the paper): https://github.com/ben-manes/caffeine and https://arxiv.org/pdf/1512.00727.pdf
comment by thomasmg · 2021-08-11 · in Bloom Filters: More than a space-efficient hashmap -
…[3] https://docs.google.com/spreadsheets/d/16wEq5QBzqOtownEtZvZe... [4] https://github.com/ben-manes/caffeine/blob/master/simulator/... [5] https://github.com/ben-manes/caffeine/blob/master/simulator/...
comment by NovaX · 2021-04-19 · in Linux Kernel: The multi-generational LRU -
…than suffer much lower hit rates or have long pauses on a write due to eviction inefficiencies. [1] https://github.com/ben-manes/caffeine/wiki/Benchmarks#read-1... [2] https://github.com/ben-manes/caffeine/blob/master/caffeine/s...
comment by NovaX · 2021-04-17 · in Segcache: A memory-efficient and scalable key-value cache for small objects [pdf] -
…definitely the most relevant and relatable when I was involved in this area a few years back. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency#window... [2] https://scholar.google.com/citations?user=kWivlnsAAAAJ&hl=en [3]…
comment by donavanm · 2021-03-14 · in Multigenerational LRU: more performant, versatile, straightforward than Linux's -
…there is interest in replacing ARC, all of our contacts were too busy to explore that option. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by NovaX · 2021-03-14 · in Multigenerational LRU: more performant, versatile, straightforward than Linux's -
…seems okayish by borrowing LIRS' ideas, but I think it performs worse in most comparisons. [1] https://github.com/ben-manes/caffeine/blob/master/simulator/... [2] https://github.com/ben-manes/caffeine/blob/master/simulator/... [3]…
comment by NovaX · 2021-03-14 · in Multigenerational LRU: more performant, versatile, straightforward than Linux's -
…to correct for LRU-biased workloads [2]. [1] https://dl.acm.org/doi/10.1145/3274808.3274816 [2] https://github.com/ben-manes/caffeine/wiki/Efficiency#adapti...
comment by NovaX · 2020-08-28 · in Constant Time LFU -
…access. This is worth a read: https://blog.dgraph.io/post/introducing-ristretto-high-perf-... [1]: https://github.com/ben-manes/caffeine
comment by mrjn · 2019-12-27 · in Efficient cache for gigabytes of data written in Go -
…and I briefly outlined my understanding of the current state when responding to a github issue: https://github.com/ben-manes/caffeine/issues/345#issuecommen...
comment by NovaX · 2019-09-21 · in Ristretto: A High Performance, Concurrent, Memory-Bound Go Cache -
…set a timeout on the future as the entry will be discarded if the future results in an error. [1] https://github.com/ben-manes/caffeine/wiki/Population
comment by NovaX · 2019-04-18 · in Thundering Herds and Promises -
…a cache should excel at. Unfortunately LRU doesn't because it can be easily polluted. (examples: https://github.com/ben-manes/caffeine/wiki/Efficiency ) A database will often scan many records which would flush an LRU. Postgres uses small…
comment by NovaX · 2019-03-11 · in The State of Caching in Go -
Caffeine, a caching library for Java, has a nice write-up on more advanced cache eviction strategies. https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by pvorb · 2019-02-18 · in Cache Eviction: When Are Randomized Algorithms Better Than LRU? (2014) -
…than LRU on most workloads is Window TinyLFU. Some nice simulations and graphs can be found here: https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by npstr · 2019-02-18 · in Cache Eviction: When Are Randomized Algorithms Better Than LRU? (2014) -
…at a random index and increment for the key on each operation. This is a good example in Java, https://github.com/ben-manes/caffeine/blob/master/caffeine/s... I would expect ~15-30ns per integer key lookup on a decent hashtable, w/o…
comment by NovaX · 2019-01-06 · in Rust at speed – building a fast concurrent database [video] -
…disabled), 224 GB, Ubuntu 15.04. They show a slight superlinear growth for reads (Caffeine). https://github.com/ben-manes/caffeine/wiki/Benchmarks#server... Both benchmarks use a Zipf distribution. I believe he said it only supports…
comment by NovaX · 2019-01-06 · in Rust at speed – building a fast concurrent database [video] -
…Caffeine which I think shares authors with Guava's cache. Kind of a 2.0 /lessons learned iteration. https://github.com/ben-manes/caffeine
comment by dangets · 2018-06-30 · in How not to structure database-backed web apps: performance bugs in the wild -
…number. It comes off a little biased since LIRS outperforms ARC in most of their own traces. https://github.com/ben-manes/caffeine/wiki/Simulator
comment by NovaX · 2018-06-16 · in Caching Beyond RAM: The Case for NVMe -
…as many believe. LIRS or TinyLFU based policies are what new implementations should be based on. https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by NovaX · 2018-06-15 · in Caching Beyond RAM: The Case for NVMe -
…the hit rate, and using hill climbing to adjust the region sizes to best fit the workload. [1] https://github.com/ben-manes/caffeine/wiki/Efficiency#glimps...
comment by NovaX · 2017-04-19 · in Cache eviction: when are randomized algorithms better than LRU? (2014) -
…supported in a bunch of other libraries: https://github.com/AsyncHttpClient/async-http-client/ , https://github.com/ben-manes/caffeine , https://github.com/mp911de/lettuce .
comment by tomfitz · 2017-02-20 · in Java libraries you can't miss in 2017 -
▲ 3
Caffeine: A high performance caching library for Java 8story by based2 · 2016-11-03 · 0 comments
-
…database and search workloads. It is also much simpler to implement and is more memory efficient. https://github.com/ben-manes/caffeine/wiki/Efficiency The W-TinyLFU variant better handles recency by using an admission window so that new…
comment by NovaX · 2016-07-30 · in Random notes on improving the Redis LRU algorithm -
…[1] I recommend reading the TinyLFU paper as I think it is the best match to your ideas. [2] [1] https://github.com/ben-manes/caffeine [2] http://arxiv.org/pdf/1512.00727.pdf
comment by NovaX · 2016-04-24 · in Ask HN: Cache Hit Ratio -
TinyLFU+FIFO is in the simulator ( https://github.com/ben-manes/caffeine/wiki/Simulator ). However, you'd probably also want the window cache to correct the deficiency outlined in the updated paper ( http://arxiv.org/pdf/1512.00727.pdf ).…
comment by NovaX · 2016-01-29 · in Apache Traffic Server -
…. Gil submitted it to Caffeine (Java caching library) last summer, https://github.com/ben-manes/caffeine/pull/24 . It got some traction over the winter and is now showing up in other places ( https://issues.apache.org/jira/br
comment by donavanm · 2016-01-29 · in Apache Traffic Server -
▲ 21
Beyond the LRU cache policystory by japaget · 2015-11-10 · 4 comments
-
…are very similar, but those that take advantage of historic data can make more intelligent choices. https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by NovaX · 2015-10-27 · in File system replacement algorithms (2006) -
…eviction policy that outperforms LRU [3]. [1] https://github.com/memcached/memcached/pull/97 [2] https://github.com/ben-manes/caffeine/wiki/Design [3] https://github.com/ben-manes/caffeine/wiki/Efficiency
comment by NovaX · 2015-09-26 · in Clarifications about Redis and Memcached -
▲ 2
A high performance caching library for Java 8story by shagunsodhani · 2015-09-18 · 1 comment
-
* Benchmarks: https://github.com/ben-manes/caffeine/wiki/Benchmarks * Design: https://github.com/ben-manes/caffeine/wiki/Design This is an evolution of two previously successful caching libraries: * ConcurrentLinkedHashMap:…
comment by NovaX · 2015-03-24 · in Caffeine – Java 8 caching -
▲ 3
Caffeine – Java 8 cachingstory by NovaX · 2015-03-24 · 1 comment