dgraph-io / ristretto

A high performance memory-bound Go cache

Home Page:https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhance cache with BP-Wrapper optimizations

mangalaman93 opened this issue · comments

i am thinking to get the batching part work on top of this one https://github.com/golang/groupcache/tree/master/lru and compare before, after hit ratio and ops/sec

@mangalaman93 i see that this one has hit ratio https://github.com/dgryski/trifles/tree/master/cachetest
does this provide ops/sec https://github.com/dgraph-io/benchmarks/blob/master/cachebench/cache_bench_test.go ?

here is what the plan looks like -

buffered non lossy channel for writes initially one per client, but may add more upto max if the channel is full

I used a single write buffer because the throughput is limited by the hash table operation, since its synchronized per entry. I didn't observe the write buffer as a contention point.

when finally applying changes, write channel gets priority over reads or the perceived order needs to be preserved?

I processed reads before writes to update the policy prior to removal. The replay order probably doesn't matter, especially when later moving off LRU so it is less predictable in tests.

@kk3399 when you add the base LRU to repo, I will move the benchmarks, both performance and hit ratio benchmarks, to this repo too.

@mangalaman93 looks like neither branch creation not commits on master are allowed?

I think you can just fork the repo and work in your own fork and then, create PRs. That'd be the simplest approach.

@mangalaman93 true 😞

looks like the golang CI is running on top of master branch, should it be running on the PR branch instead? #11

also i signed CLA after creating the PR, should i abandon the PR and create it again?