You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently SimpleSmt recomputes inner node hashes on each insert. It computes and writes hashes starting from inserted node and up to the root. It might lead to unnecessary computations during bulk inserts (for example, SimpleSmt::with_leaves and SimpleSmt::with_contiguous_leaves use insert under the hood).
We can use different approaches for such optimization. For example:
Simply disable hashes calculations during bulk inserts and then create all needed inner nodes with hashes computation after operation. This approach should work fine for populating constructors (with_leaves, and similar).
Mark hashes, affected during insertion, as invalid. Recalculate lazily only invalid hashes on access to root hash. This is little more complex approach, but should work fine for random inserts.
The text was updated successfully, but these errors were encountered:
I would start with the first one - I think it should get us most of the benefit. The second one can be implemented much later (and only if we discover that we need it).
Currently
SimpleSmt
recomputes inner node hashes on each insert. It computes and writes hashes starting from inserted node and up to the root. It might lead to unnecessary computations during bulk inserts (for example,SimpleSmt::with_leaves
andSimpleSmt::with_contiguous_leaves
useinsert
under the hood).We can use different approaches for such optimization. For example:
with_leaves
, and similar).The text was updated successfully, but these errors were encountered: