mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
make the fragment cache ThresholdIndex a function at 90% of ThresholdLength
This commit is contained in:
parent
8ceaef1eaa
commit
3b71ed1b2f
1 changed files with 4 additions and 1 deletions
|
|
@ -43,6 +43,9 @@ const (
|
|||
|
||||
// HashBlockSize is the number of bitmaps in a merkle hash block.
|
||||
HashBlockSize = 100
|
||||
|
||||
// Percentage of the ThresholdLength size to resort the cache at
|
||||
ThresholdBufferPct = 0.9
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -245,7 +248,7 @@ func (f *Fragment) openCache() error {
|
|||
case CacheTypeRanked:
|
||||
c := NewRankCache()
|
||||
c.ThresholdLength = f.cacheSize
|
||||
c.ThresholdIndex = f.cacheSize - 500
|
||||
c.ThresholdIndex = int(float64(f.cacheSize) * ThresholdBufferPct)
|
||||
f.cache = c
|
||||
case CacheTypeLRU:
|
||||
f.cache = NewLRUCache(f.cacheSize)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue