-
Notifications
You must be signed in to change notification settings - Fork 446
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
Remove removed past PathHashes #7080
Conversation
@@ -104,11 +104,15 @@ public Task Execute(CancellationToken cancellationToken) | |||
if (_logger.IsWarn) _logger.Warn($"Detected {pruningConfig.CacheMb}MB of pruning cache config. Pruning cache more than 2000MB is not recommended as it may cause long memory pruning time which affect attestation."); | |||
} | |||
|
|||
// 8 bytes Node pointer, (LinkedListNode 8 pointer + 8 pointer) + (HashAndTinyPath: 32 bytes for value + 8 bytes for path) + 32 bytes ValueHash256 | |||
int KeyEntryMemorySize = 8 + (8 + 8) + (32 + 8) + 32; // 96 bytes |
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.
Can you double the default config also.
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.
Does it need 2.1M hashes?
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.
GC time is a function of number of objects (rather than size) I can redesign an Lru so it uses a giant array and indexes rather than pointers, if you want to go this high
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.
Yes, I've specifically, tune this amount.
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.
PR to eradicate the objects #7100
{ | ||
TreePath fullPath = key.path.ToTreePath(); // Micro op to reduce double convert | ||
if (CanRemove(key.addr, key.path, fullPath, prevHash, keyValuePair.Value)) | ||
{ | ||
Metrics.RemovedNodeCount++; | ||
writeBatch.Remove(key.addr, fullPath, prevHash); | ||
_pastPathHash.Delete(key); |
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.
Will this make mem pruning slower, (since it does more work), or faster? (since it become smaller).
Changes
Otherwise after a couple prunes the cache quickly grows to the maximum 2.1M items; some of which will never be used again.
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.