Repository navigation
Reduce TrieNode allocations - #5457
Conversation
|
Maybe I can change the implementation to use |
|
|
||
| public byte[]? Data { get; } | ||
|
|
||
| public int Position { get; set; } |
There was a problem hiding this comment.
If you want to micro op, I guess you can set this to a byte. Or it does not matter and overhead of casting it is higher.
There was a problem hiding this comment.
I think I'll leave as is. The stack is the stack one int or byte wont' make that much change. Also, I'll default to Rlp.ValueContext for now.
|
Doing a full sync on teku mainnet. Once it's synced and working will confirm and merge if the results are consistent. |
|
The teku mainnet has been synced with this and now is operational. Waiting for a few hours of running and will be merging if nothing contradicts the findings above. |
|
I confirm that with the usage of the Rlp context reading the version behaves as it was with the copied |
This reverts commit 5488e31.
This reverts commit 5488e31. Co-authored-by: Kamil Chodoła <[email protected]>
* _storageRoot as an array member * RlpStreamReader introduced * fixes and tests * benchmark refactored a bit * format * minor adjustements * the reader removed and usages replaced with Rlp.ValueDecoderContext
This PR removes 10% managed allocations from the node. It does it by moving
StorageRootfromTrieNodeas an item of an array and getting rid ofRlpStreamfromTrieNodeand delegating its functionality toRlp.ValueDecoderContextTests
Benchmarks
Reused
PatriciaTreeBenchmarksthat provides a coarse grained measurement of various operations.masterthis PRRunning node
masterthis PR**Image** comparing of all the metrics
Changes
StorageRootis now stored as_data[2]only in leafsRlpStreamReaderused instead of the object ofRlpStreamTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Remarks
Another approach to the
TrieNodeoptimization.