Announcing cachekit 0.7 โ pluggable cache policies and arena-backed primitives
โ Rust ๐ 2026-04-09 ๐ค surdeus ๐๏ธ 5Hi everyone,
Iโd like to share cachekit, a Rust library for high-performance in-memory caches with many eviction policies, a unified builder API, and low-allocation hot paths aimed at predictable behavior under skewed and scan-heavy workloads.
What you get
- 18 eviction policies behind
policy-*feature flags (e.g. LRU, Fast-LRU, LRU-K, LFU, 2Q, S3-FIFO, ARC, CAR, SLRU, Clock, Clock-PRO, and more). Defaults are a small subset; usepolicy-allor cherry-pick withdefault-features = falsefor smaller builds. CacheBuilderfor a single entry point, plus concrete policy types when you need policy-specific knobs.- Trait-based surface (
Cacheplus optional capability traits for eviction inspection, recency/frequency/history where applicable). dsmodule: reusable arena, ring buffers, intrusive lists, ghost lists, frequency buckets, etc. โ intended for pre-allocated, index-heavy layouts rather than per-op allocation.- Optional
metrics(hit/miss/eviction counters) andconcurrency(parking_lot-backed concurrent building blocks).
Quick start
use cachekit::builder::{CacheBuilder, CachePolicy};
let mut cache = CacheBuilder::new(1000).build::<u64, String>(CachePolicy::Lru);
cache.insert(1, "hello".to_string());
assert_eq!(cache.get(&1), Some(&"hello".to_string()));
Links
- crates.io: crates.io: Rust Package Registry
- docs.rs: cachekit - Rust
- Book-style docs: CacheKit Docs | High-performance cache policies and supporting data structures.
- Repository: GitHub - OxidizeLabs/cachekit: High-performance cache policies and supporting data structures for Rust systems, with optional metrics and benchmarks. ยท GitHub
- Changelog: cachekit/CHANGELOG.md at main ยท OxidizeLabs/cachekit ยท GitHub
- MSRV: Rust 1.85 (edition 2024).
Feedback, issue reports, and real-world workload stories are very welcome โ especially if youโre comparing policies or care about tail latency under scans.
Thanks for reading!
1 post - 1 participant
๐ท๏ธ Rust_feed