# README
tannin
Tannin is implementation of W-TinyLRU cache, that was implemented in Caffeine as eviction policy. Later it was adopted to Ristretto cache library.
Example
import (
"fmt"
tannin "github.com/floatdrop/tannin"
)
func main() {
cache := tannin.New[string, int](256, 100)
cache.Set("Hello", 5)
if e := cache.Get("Hello"); e != nil {
fmt.Println(*e)
// Output: 5
}
}
Benchmarks
floatdrop/tannin
BenchmarkTannin_Rand-8 3957745 295.8 ns/op 84 B/op 7 allocs/op
BenchmarkTannin_Freq-8 4598648 255.7 ns/op 78 B/op 7 allocs/op