Assess and memoize (if appropriate) SignedTransaction::sha256_of_proto_encoding
#1352
Labels
ENG-667
ignore-stale
Override for issues or PRs which should not be removed if stale.
performance
stale
tech-debt
We should run an ad hoc test under semi-realistic conditions which counts how many times
SignedTransaction::sha256_of_proto_encoding
is a repeated call on aSignedTransaction
instance. In other words, if we only ever call this once per instance, the total will be zero. If we call it exactly thrice per instance, the total will be twice the number of instances.Once we have this information, we can decide whether to implement memoization of the tx hash as a field in the tx, or leave as is.
After brief discussion with @SuperFluffy, it might be better to just make this hash a normal member field rather than a lazily-initialized
OnceCell
for example, since the hash is probably almost always calculated for every signed transaction. Confer before implementing any changes to agree on an approach.┆Issue Number: ENG-697
The text was updated successfully, but these errors were encountered: