-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache rebuild #124
Cache rebuild #124
Conversation
@@ -104,6 +105,7 @@ func NewRocksDBStoreOpts(opts *Options) (*RocksDBStore, error) { | |||
cfOpts := []*rocksdb.Options{ | |||
rocksdb.NewDefaultOptions(), | |||
getHyperTableOpts(blockCache), | |||
getHyperTableOpts(blockCache), // hyperCacheOpts table options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open an issue to optimize this options
|
||
} | ||
|
||
func TestRebuildInterpretation(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recover this test
balloon/hyper/rebuild.go
Outdated
) | ||
|
||
func pruneToRebuild(index, serializedBatch []byte, cacheHeightLimit uint16, batches batchLoader) *operationsStack { | ||
func pruneToRebuildBulk(indexes [][]byte, cacheHeightLimit uint16, batches batchLoader) *operationsStack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename cacheHeightLimit
balloon/balloon.go
Outdated
func NewBalloon(store storage.Store, hasherF func() hashing.Hasher) (*Balloon, error) { | ||
|
||
// create trees | ||
historyTree := history.NewHistoryTree(hasherF, store, 300) | ||
hyperTree := hyper.NewHyperTree(hasherF, store, cache.NewFreeCache(hyper.CacheSize)) | ||
hasher := hasherF() | ||
cacheHeightLimit := hasher.Len() - min(24, hasher.Len()/8*4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this
key := pos.Bytes() | ||
val := batch.Serialize() | ||
c.Cache.Put(key, val) | ||
if pos.Height == c.RecoveryHeight { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider to include this in the pruner as a new mutateOp
balloon/hyper/rebuild.go
Outdated
) | ||
|
||
func pruneToRebuild(index, serializedBatch []byte, cacheHeightLimit uint16, batches batchLoader) *operationsStack { | ||
func pruneToRebuildBulk(indexes [][]byte, cacheHeightLimit uint16, batches batchLoader) *operationsStack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename function name to pruneToRebuild
…ark code to measure its performance against the regular code
New cache recovery strategy. From ~1200 to ~7 seconds adding one write per operation.
Co-authored-by: @aalda