Skip to content

Commit

Permalink
blockstore: move ARC cache below the bloom cache
Browse files Browse the repository at this point in the history
ARC cache is influenced by requests and bloom isn't
This means that if bloom is able to remove some requests caching them in
ARC is pointless.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Sep 5, 2016
1 parent 50bfc66 commit 6aff024
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blocks/blockstore/caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ func CachedBlockstore(bs GCBlockstore,
if opts.HasBloomFilterSize != 0 && opts.HasBloomFilterHashes == 0 {
return nil, errors.New("bloom filter hash count can't be 0 when there is size set")
}
if opts.HasBloomFilterSize != 0 {
cbs, err = bloomCached(cbs, ctx, opts.HasBloomFilterSize, opts.HasBloomFilterHashes)
}

if opts.HasARCCacheSize > 0 {
cbs, err = newARCCachedBS(cbs, ctx, opts.HasARCCacheSize)
}
if opts.HasBloomFilterSize != 0 {
cbs, err = bloomCached(cbs, ctx, opts.HasBloomFilterSize, opts.HasBloomFilterHashes)
}

return cbs, err
}

0 comments on commit 6aff024

Please sign in to comment.