Skip to content

Commit

Permalink
blocks/blockstore: add CacheOpts - structure of cache config
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Jul 8, 2016
1 parent a8d9002 commit 3035aa8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions blocks/blockstore/caching.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package blockstore

// Next to each option is it aproximate memory usage per unit
type CacheOpts struct {
HasBloomFilterSize int // 1 bit
HasBloomFilterHashes int // No size, 7 is usually best, consult bloom papers
HasARCCacheSize int // 32 bytes
}

func DefaultCacheOpts() CacheOpts {
return CacheOpts{
HasBloomFilterSize: 512 * 8 * 1024,
HasBloomFilterHashes: 7,
HasARCCacheSize: 64 * 1024,
}
}

0 comments on commit 3035aa8

Please sign in to comment.