Show HN: Quite Fast, sharded cache for Go with LRU/LFU, TTL and object pooling
9 months ago
- #go
- #cache
- #performance
- Kioshun cache library benchmark results show high performance with up to 326M+ operations/sec for GET operations.
- Installation is simple with `go get github.com/unkn0wn-root/kioshun`.
- Quick start example demonstrates basic cache operations like Set, Get, and Delete.
- Configuration options include MaxSize, ShardCount, CleanupInterval, DefaultTTL, and EvictionPolicy.
- Architecture is sharded to minimize lock contention, with automatic sharding and optimal shard count based on CPU cores.
- API Reference includes methods like Set, Get, Delete, Exists, Clear, Size, Stats, and Close.
- HTTP Middleware supports various frameworks (Gin, Echo, Chi, Gorilla Mux) with configurable caching policies.
- Cache Invalidation Setup requires path-based key generators for pattern-based invalidation to work.