-
Notifications
You must be signed in to change notification settings - Fork 488
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
Shrink Trienodes #7915
Shrink Trienodes #7915
Conversation
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.
Should we change Keccak from Hash256?
to ValueHash256?
?
|
||
private readonly CappedArray<byte> _value; | ||
|
||
public byte[] Key { get; set; } |
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.
Inline array?
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.
Is a bunch of follow up work that can be done; but probably good as now
Problematic since the entries in the level above are TrieNode or Hash256; so either the inline array in branches goes from 128 bytes to 512 bytes, or we box the ValueHash256 so it can go in an object reference, but then might as well have just kept it as a Hash256? |
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.
LGTM
Changes
TrieNode _storageRoot
only needs to exist on Leaf saving 8 bytesLastSeen
can be combined with the other flags saving 8 bytes_data
can be converted to fields/inline array saving 24 bytes; and removing one object per TrieNode (are a lot of object in trie and GC time is a function of object count)Before
After
Types of changes
What types of changes does your code introduce?