mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-03-04 07:47:35 +08:00
ascend to degree three for parallelism
This commit is contained in:
parent
ffca887406
commit
13400ec85c
@ -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{}{}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user