TLDR Web Dev · MISCELLANEOUS
THE EVOLUTION OF CACHING LIBRARIES IN GO
Summary from the TLDR Web Dev newsletter
On-heap caches store data in the heap memory managed by Go's garbage collector. Go caching libraries have progressed from early mutex-protected maps to advanced libraries like Ristretto (2019), which became dominant but had issues with breaking changes and suboptimal performance on certain workloads. Theine was released in 2023 and implemented more efficient algorithms from Java's Caffeine library, including adaptive W-TinyLFU for better hit rates.