Compare commits
2 Commits
versa_perf
...
versa_perf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c8fb28c99 | ||
|
|
6d41ff8190 |
@@ -23,7 +23,6 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
@@ -1217,7 +1216,6 @@ func (s *StateDB) AccountsIntermediateRoot() {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
var calcStateObjectCount atomic.Int64
|
|
||||||
// Although naively it makes sense to retrieve the account trie and then do
|
// Although naively it makes sense to retrieve the account trie and then do
|
||||||
// the contract storage and account updates sequentially, that short circuits
|
// the contract storage and account updates sequentially, that short circuits
|
||||||
// the account prefetcher. Instead, let's process all the storage updates
|
// the account prefetcher. Instead, let's process all the storage updates
|
||||||
@@ -1228,9 +1226,6 @@ func (s *StateDB) AccountsIntermediateRoot() {
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
tasks <- func() {
|
tasks <- func() {
|
||||||
obj.updateRoot()
|
obj.updateRoot()
|
||||||
if obj.trie != nil {
|
|
||||||
calcStateObjectCount.Add(1)
|
|
||||||
}
|
|
||||||
// Cache the data until commit. Note, this update mechanism is not symmetric
|
// Cache the data until commit. Note, this update mechanism is not symmetric
|
||||||
// to the deletion, because whereas it is enough to track account updates
|
// to the deletion, because whereas it is enough to track account updates
|
||||||
// at commit time, deletions need tracking at transaction boundary level to
|
// at commit time, deletions need tracking at transaction boundary level to
|
||||||
@@ -1244,7 +1239,6 @@ func (s *StateDB) AccountsIntermediateRoot() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
log.Info("versa calc root state object", "count", calcStateObjectCount.Load(), "version", s.db.GetVersion()+1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StateDB) StateIntermediateRoot() common.Hash {
|
func (s *StateDB) StateIntermediateRoot() common.Hash {
|
||||||
@@ -1625,7 +1619,6 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
var committedStateObjectNum atomic.Int64
|
|
||||||
for addr := range s.stateObjectsDirty {
|
for addr := range s.stateObjectsDirty {
|
||||||
if obj := s.stateObjects[addr]; !obj.deleted {
|
if obj := s.stateObjects[addr]; !obj.deleted {
|
||||||
tasks <- func() {
|
tasks <- func() {
|
||||||
@@ -1635,9 +1628,6 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
|
|||||||
taskResults <- taskResult{err, nil}
|
taskResults <- taskResult{err, nil}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
if obj.trie != nil {
|
|
||||||
committedStateObjectNum.Add(1)
|
|
||||||
}
|
|
||||||
taskResults <- taskResult{nil, set}
|
taskResults <- taskResult{nil, set}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1720,7 +1710,6 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
log.Info("versa commit state object", "count", committedStateObjectNum.Load(), "version", s.db.GetVersion()+1)
|
|
||||||
return nil
|
return nil
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
@@ -29,20 +29,14 @@ func New(config *Config) *VersionDB {
|
|||||||
if config != nil {
|
if config != nil {
|
||||||
path = config.Path
|
path = config.Path
|
||||||
cfg = &versa.VersaDBConfig{
|
cfg = &versa.VersaDBConfig{
|
||||||
FlushInterval: 2000,
|
FlushInterval: 6000,
|
||||||
MaxStatesInMem: 128,
|
MaxStatesInMem: 128,
|
||||||
MemLowWaterMark: 40,
|
|
||||||
MemHighWaterMark: 60,
|
|
||||||
MemEvictInternal: 200,
|
|
||||||
}
|
}
|
||||||
_ = cfg
|
_ = cfg
|
||||||
}
|
}
|
||||||
db, err := versa.NewVersaDB(path, &versa.VersaDBConfig{
|
db, err := versa.NewVersaDB(path, &versa.VersaDBConfig{
|
||||||
FlushInterval: 2000,
|
FlushInterval: 6000,
|
||||||
MaxStatesInMem: 128,
|
MaxStatesInMem: 128,
|
||||||
MemLowWaterMark: 40,
|
|
||||||
MemHighWaterMark: 60,
|
|
||||||
MemEvictInternal: 200,
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("failed to new version db", "error", err)
|
log.Crit("failed to new version db", "error", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user