mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
trie/bintrie: drop rot-prone alloc number from collectNodes comment
The number ("~17 allocs/op") pins a value that was specific to one
microbenchmark on one revision; any change to BenchmarkCollectNodesSparseWrite's
shape or size shifts it. The invariant (flushfn consumers clone via
string(path), so in-place mutation is safe) is what future readers
need to know.
This commit is contained in:
parent
c24930bebf
commit
d85cb3f078
1 changed files with 1 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ func (s *nodeStore) collectNodes(ref nodeRef, path []byte, flushfn nodeFlushFn)
|
|||
}
|
||||
// Reuse path buffer across children: flushfn consumers
|
||||
// (NodeSet.AddNode, tracer.Get) clone via string(path), so in-place
|
||||
// mutation is safe. Saves ~17 allocs/op on this benchmark.
|
||||
// mutation is safe.
|
||||
path = append(path, 0)
|
||||
if err := s.collectNodes(node.left, path, flushfn); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Reference in a new issue