Get the latest tech news
The Evolution of Caching Libraries in Go
¶ For the last few years, I've been developing caching library, and today I'd like to talk about the evolution of caches in Go and where we stand today. Especially since Go 1.24 was officially supposed to focus on caching improvements, but I haven't heard much news about them - time to fix that .
Lossy read buffers aren't ideal: they consume noticeable memory for small caches, and more critically, can significantly reduce hit rates under high contention. I started developing Otter v1 in mid 2023 when we discovered a severe hit rate degradation after attempting to update dependencies in a legacy service that used one of Ristretto's earliest versions. As mentioned in the Theine discussion, lossy read buffers aren’t ideal: They consume noticeable memory for small caches and, more critically, can significantly reduce hit rate under high contention.
Or read this on Hacker News