Go developer builds pacecache, a new in-memory cache library with deliberate trade-offs
A developer has released pacecache, a new open-source in-memory cache library for the Go programming language, designed around explicit control over capacity, expiration, and concurrency. Rather than claiming universal superiority, the project acknowledges that cache design involves trade-offs across factors like lock contention, eviction quality, and memory overhead. Pacecache uses an entry-count budget instead of a byte-size memory limit, with a default cap of 10,000 entries and exact LRU-based eviction. The library supports optional segmentation to reduce lock contention under heavy concurrency, though uneven key distribution can cause some segments to evict entries while others remain underutilised. Additional features include configurable TTL with jitter to stagger expiration deadlines, per-entry expiration policies, and optional sliding expiration that refreshes an entry's deadline on successful read.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in