Commit 82da4c45 authored by Steven Allen's avatar Steven Allen

cache: switch to 2q

Due to patent concerns in closed-source downstream products:
https://github.com/ipfs/go-ipfs/issues/6590
parent 8d6a694a
......@@ -16,7 +16,7 @@ type cacheSize int
// block Cids. This provides block access-time improvements, allowing
// to short-cut many searches without query-ing the underlying datastore.
type arccache struct {
arc *lru.ARCCache
arc *lru.TwoQueueCache
blockstore Blockstore
hits metrics.Counter
......@@ -24,7 +24,7 @@ type arccache struct {
}
func newARCCachedBS(ctx context.Context, bs Blockstore, lruSize int) (*arccache, error) {
arc, err := lru.NewARC(lruSize)
arc, err := lru.New2Q(lruSize)
if err != nil {
return nil, err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment