mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +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/types/bal"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
"runtime"
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
@ -330,6 +331,7 @@ func (p *ParallelStateProcessor) Process(block *types.Block, stateTransition *st
|
||||||
tExecStart = time.Now()
|
tExecStart = time.Now()
|
||||||
go p.resultHandler(block, stateReads, postTxState, tExecStart, txResCh, rootCalcResultCh, resCh)
|
go p.resultHandler(block, stateReads, postTxState, tExecStart, txResCh, rootCalcResultCh, resCh)
|
||||||
var workers errgroup.Group
|
var workers errgroup.Group
|
||||||
|
workers.SetLimit(runtime.NumCPU())
|
||||||
startingState := statedb.Copy()
|
startingState := statedb.Copy()
|
||||||
for i, tx := range block.Transactions() {
|
for i, tx := range block.Transactions() {
|
||||||
tx := tx
|
tx := tx
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue