Skip to content

Commit

Permalink
performance: commitTire concurrently (bnb-chain#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
brilliant-lx authored and whw188 committed Dec 6, 2023
1 parent aee5cd5 commit 23c350f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,7 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
go commmitTrie()
} else {
defer s.StopPrefetcher()
commitFuncs = append(commitFuncs, commmitTrie)
}
commitRes := make(chan error, len(commitFuncs))
for _, f := range commitFuncs {
Expand All @@ -1823,10 +1824,6 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
return common.Hash{}, nil, r
}
}
// commitFuncs[1] and commmitTrie concurrent map `storages` iteration and map write
if err := commmitTrie(); err != nil {
return common.Hash{}, nil, err
}

root := s.stateRoot
if s.pipeCommit {
Expand Down

0 comments on commit 23c350f

Please sign in to comment.