~whereswaldon/arbor-dev#69: 
Prevent UnmarshalBinaryNode from re-serializing nodes to compute their IDs

The existing forest.UnmarshalBinaryNode() method is used frequently, but has a severe bottleneck. The current implementation computes the ID of the node after deserializing it by calling ArborSerialize() on it and hashing the result. Since we started with the binary form of the node in the first place, this work is completely unnecessary. Note: The existing implementation doesn't explicitly call ArborSerialize, it happens several levels down the call stack. There are many possible ways to address this, and I'm happy to discuss them.

To properly fix this, we need:

  • [ ] A benchmark demonstrating the pre-fix performance
  • [ ] An improved implementation that re-uses the binary form of the node to compute the hash
  • [ ] Post-optimization benchmarks performance
Status
REPORTED
Submitter
~whereswaldon
Assigned to
No-one
Submitted
7 months ago
Updated
6 months ago
Labels
forest-go help-wanted