A big part of all reads is encoding and decoding. We should improve our rlp encoding and decoding of trie elements as it seems to be pretty slow and significant (e.g. more than twice the length of db access in some measurements).
The main culprit seems to be allocation.
Some ideas:
A big part of all reads is encoding and decoding. We should improve our rlp encoding and decoding of trie elements as it seems to be pretty slow and significant (e.g. more than twice the length of db access in some measurements).
The main culprit seems to be allocation.
Some ideas:
RLPEncodetrait encode to calculate the length instead of implementing the recursivelengthfunction. Implementing that function avoids half of the allocations and memcpys of arrays and structs.encode_to_vecin loop that can be replaced withencodeand recycle the buffer.