perf: store HashBuilder.value
as a Vec<u8>
and track kind separately
#45
Labels
HashBuilder.value
as a Vec<u8>
and track kind separately
#45
The current API of
HashBuilder::leaf
creates a new allocation for each new value. This is wasteful, and should instead re-use an internal buffer like we're doing for RLP.Practically, this means replacing
value
with aVec<u8>
and a separate flag to track whether it is a hash or a leaf value. Theadd_*
APIs should remain the same, and internally they will clear the buffer, copy the new value in, and set the flag.The text was updated successfully, but these errors were encountered: