ristretto

package
v0.0.0-...-8c930d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ristretto is a TinyLFU-admission cache.

It is not the forwarded default and must not become one without solving this: once the resident set is warm, the admission policy rejects a new key whose estimated frequency loses to the sampled eviction victims, and the rejection happens asynchronously after Set has already returned nil. The caller is told the write succeeded and the very next Get misses — measured at roughly 95% of newcomer writes on a warm cache. Wait does not help: it drains the write buffer, while the rejection happens after.

What it is still good for: scan resistance. It is the only backend here that keeps a hot working set intact across a sweep over a large key space.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache[T any]() types.Cache[T]

Cache returns the process-wide ristretto cache of type T, creating it on first use.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址