OxidizeLabs/cachekit: High-performance cache policies (FIFO/LRU/LRU-K) and tiered caching primitives for Rust systems, with optional metrics and benchmarks.

Date:

Share:


Crates.io
Docs
MSRV
License: MIT
License: Apache-2.0

High-performance cache policies and tiered caching primitives for Rust systems with optional metrics and benchmarks.

CacheKit is a Rust library that provides:

  • High-performance cache replacement policies (e.g., FIFO, LRU, LRU-K).
  • Tiered caching primitives to build layered caching strategies.
  • Optional metrics and benchmark harnesses.
  • A modular API suitable for embedding in systems where control over caching behavior is critical.

This crate is designed for systems programming, microservices, and performance-critical applications.

  • Policy implementations optimized for performance and predictability.
  • Backends that support both in-memory and composite cache strategies.
  • Optional integration with metrics collectors (e.g., Prometheus/metrics crates).
  • Benchmarks to compare policy performance under real-world workloads.
  • Idiomatic Rust API with no_std compatibility where appropriate.
  • docs/design.md — Architectural overview and design goals.
  • docs/policies/README.md — Implemented policies and roadmap.
  • docs/policy-ds/README.md — Data structure implementations used by policies.
  • docs/policies.md — Policy survey and tradeoffs.
  • docs/style-guide.md — Documentation style guide.
  • docs/release-checklist.md — Release readiness checklist.
  • docs/releasing.md — How to cut a release (tag, CI, publish, docs).
  • docs/ci-cd-release-cycle.md — CI/CD overview for releases.
  • docs/integration.md — Integration notes (placeholder).
  • docs/metrics.md — Metrics notes (placeholder).

Add cachekit as a dependency in your Cargo.toml:

[dependencies]
cachekit = { git = "https://github.com/OxidizeLabs/cachekit" }
use cachekit::policy::lru_k::LRUKCache;

fn main() {
    // Create an LRU cache with a capacity of 100 entries
    let mut cache = LRUKCache::new(2);

    // Insert an item
    cache.insert("key1", "value1");

    // Retrieve an item
    if let Some(value) = cache.get(&"key1") {
        println!("Got from cache: {}", value);
    }
}

Source link

Subscribe to our magazine

━ more like this

Mix and mismatch: if it doesn’t go with anything, it goes with everything | Fashion

Fashion is a dance between rules and rebellion. Great style requires a bit of both. The rules are essential, because one of the key...

Suki And Poppy’s Guide To Wellness

Take a moment and think about your best friend. (Ah, now isn’t this nice?) What’s funny about best friends is that more often than...

Clockwise #639: I’m Saying Words I Don’t Really Know What They Mean

Support this show Enjoy Clockwise Unwound: Ad-free episodes and an extra Overtime topic every week. #639: I'm Saying Words I Don't Really Know What They Mean January...

“Streamflation” Is Real: Streaming video prices soared by 19.5%

According to the BLS data, “Subscription and rental of video and video games” saw inflation of 19.5...

How to Find a Cheap Car Rental in 2026

I love road trips. You get in car and can just head off anywhere you want. There’s a freedom to a road trip that...