Overview of Stretto features
mainStretto is a high-performance, thread-safe, memory-bound Rust cache. It is a pure Rust implementation of the Ristretto cache.
Key features include:
- Internal Mutability: You can use
Cache<...>orAsyncCache<...>directly in concurrent code without needing to wrap them inArc<RwLock<...>>. - Sync and Async Support: Supports both synchronous and runtime-agnostic asynchronous usage.
- High Hit Ratios: Uses a combination of TinyLFU for admission and SampledLFU for eviction to achieve best-in-class performance.
- Cost-Based Eviction: Allows for eviction based on arbitrary costs, enabling large items to evict multiple smaller items.
- Fully Concurrent: Designed for high throughput with minimal contention across many threads.
- Store Policy: Stretto stores only the value, not the key.
- Metrics: Provides optional performance metrics for throughput, hit ratios, and other statistics.