mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-14 02:41:34 +00:00
Gballet asked (comment 3099953085) to leave the sha256Sum256 / constant parallelHashDepth optimisation out of this PR: it's an orthogonal microbenchmark concern that should be revisited post-group-depth under Go 1.26. - Delete the sha256Sum256 helper from hasher.go. - Delete the const parallelHashDepth = 4 from hasher.go. - Restore master's dynamic parallelDepth() helper in store_commit.go (copy verbatim — min(bits.Len(NumCPU), 8)). - In hashInternal's shallow-parallel branch, call sha256.Sum256 directly (std-lib, stack-allocated [32]byte; common.Hash is a type alias for [32]byte so no conversion needed). - In hashInternal's deep-sequential branch, use the pooled newSha256 / returnSha256 hasher (matches master's internal_node.go:170-185). Intentional trade-off: the deep branch now re-introduces per-hash sync.Pool Get/Put plus a 32-byte h.Sum(nil) allocation. Zero regression vs master; foregoes the arena's proposed stack-based hashing until Go 1.26 + post-group-depth benchmarks. |
||
|---|---|---|
| .. | ||
| binary_node.go | ||
| binary_node_test.go | ||
| hashed_node.go | ||
| hashed_node_test.go | ||
| hasher.go | ||
| internal_node.go | ||
| internal_node_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| key_encoding.go | ||
| node_ref.go | ||
| node_store.go | ||
| stem_node.go | ||
| stem_node_test.go | ||
| store_commit.go | ||
| store_ops.go | ||
| trie.go | ||
| trie_test.go | ||