Node should re-use instances of `hash.Hash` by using a `sync.Pool`
fasmat opened this issue · comments
Matthias Fasching commented
Description
This issue came up in a discussion here: #5784 (comment)
Every time the node hashes data it re-instantiates hash.Hash
objects, which is slow and can be mitigated by using a sync.Pool
.
Affected code
An example would be here:
Other places where instances of hash are created should also be checked to be re-used.