ascend to degree three for parallelism

This commit is contained in:
Cassandra Heart 2025-03-27 21:15:24 -05:00
parent ffca887406
commit 13400ec85c
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -104,9 +104,12 @@ func (n *LazyVectorCommitmentBranchNode) Commit(
vector := make([][]byte, len(n.Children))
wg := sync.WaitGroup{}
workers := 1
if n.LongestBranch <= 2 {
if n.LongestBranch <= 3 {
workers = runtime.WorkerCount(0, false)
}
if n.LongestBranch > 3 {
fmt.Printf("DEBUG: Performing commit under %v path, leaves: %d\n", path, n.LeafCount)
}
throttle := make(chan struct{}, workers)
for i, child := range n.Children {
throttle <- struct{}{}