mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-13 05:08:35 +00:00
perf experiment: limit the number of concurrently-executing txs to the number of CPUs
This commit is contained in:
parent
64558ff6aa
commit
898ff115ac
1 changed files with 2 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/types/bal"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"runtime"
|
||||
"slices"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -330,6 +331,7 @@ func (p *ParallelStateProcessor) Process(block *types.Block, stateTransition *st
|
|||
tExecStart = time.Now()
|
||||
go p.resultHandler(block, stateReads, postTxState, tExecStart, txResCh, rootCalcResultCh, resCh)
|
||||
var workers errgroup.Group
|
||||
workers.SetLimit(runtime.NumCPU())
|
||||
startingState := statedb.Copy()
|
||||
for i, tx := range block.Transactions() {
|
||||
tx := tx
|
||||
|
|
|
|||
Loading…
Reference in a new issue