mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 00:39:31 +08:00
blocks/blockstore: add CacheOpts - structure of cache config
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
16
blocks/blockstore/caching.go
Normal file
16
blocks/blockstore/caching.go
Normal file
@ -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,
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user