This is a Rust implementation for popular caches (support no_std).
This is a Rust implementation for popular caches (support no_std).
See Introduction, Installation and Usages for more details.
English | 简体中文
The MSRV for this crate is 1.55.0.
LRUCache
, SegmentedCache
, TwoQueueCache
and AdaptiveCache
.TinyLFU
, SampledLFU
, and WTinyLFUCache
[dependencies]
caches = "0.2"
[dependencies]
caches = { version: "0.2", default-features = false }
Please see examples
.
The implementation of RawLRU
is highly inspired by
Jerome Froelich's LRU implementation
and std::collections
library of Rust.
Thanks for HashiCorp's golang-lru providing the amazing Go implementation.
Ramakrishna's paper: Caching strategies to improve disk system performance
The implementation of TinyLFU and SampledLFU are inspired by Dgraph's ristretto and dgryski's go-tinylfu.
Gil Einziger's paper: TinyLFU: A Highly Efficient Cache Admission Policy
0.2
: Support TinyLFU, SampledLFU, WTinyLFUCache0.3
: Support LIRS, DLIRS, DSLRU0.4
: Add ttl feature to support