lru icon indicating copy to clipboard operation
lru copied to clipboard

High performance LRU cache

Results 12 lru issues
Sort by recently updated
recently updated
newest added

possible to have an onevict call back feature for both the ttl and non ttl version?

bug
enhancement

@phuslu pls pls pls implement a mmap option that can be shared across golang inter process. can buy u a few coffees for this. possible to get it done? maybe...

enhancement

i'll be honored to have your feedback on this lru i created for your comparison, remarks and comments. hope to have your comments / input https://github.com/cloudxaas/gocache/tree/main/lru/bytes you can try on...

question

After reading https://github.com/scalalang2/go-cache-benchmark/issues/4 , especially @maypok86’s comment. I think below points should be clarify for fairness 1. CPU cores choosing (8/16 cores or higher) 2. GitHub actions environment (busy github...

documentation
enhancement

wanted to go extreme, how to make 192 cores faster? same pastebin info on server, doesnt really scale that well. can suggest how to make it multicore shard better?

question

测试代码: ```go package main import ( "fmt" "time" "github.com/phuslu/lru" ) func main() { cache := lru.NewTTLCache[int, int](1024) for i := 0; i < 1000; i++ { cache.Set(i, i, time.Hour) }...

GetOrLoad returns `(value V, err error, ok bool)`, but the `ok` parameter is a bit strange: - If the value was in cache then it's always `true`. - If the...

When using `GetOrLoad` for the LRU cache it can be very useful to know how many of the keys ended up never being retrieved again. Excluding these keys makes sense...

enhancement

## Description When we specify two or more shards, our current algorithm leads to uneven key distribution, causing some data to be overwritten and resulting in incorrect cache lengths. Please...

I hope that there will be a way to add parameters or manually start a goroutine to periodically clean up expired keys.