@@ -151,7 +151,6 @@ type StateDB struct {
151151 AccountUpdates time.Duration
152152 AccountCommits time.Duration
153153 StorageReads time.Duration
154- StorageHashes time.Duration
155154 StorageUpdates time.Duration
156155 StorageCommits time.Duration
157156 SnapshotAccountReads time.Duration
@@ -856,6 +855,7 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
856855 // the account prefetcher. Instead, let's process all the storage updates
857856 // first, giving the account prefetches just a few more milliseconds of time
858857 // to pull useful data from disk.
858+ start := time .Now ()
859859 for addr , op := range s .mutations {
860860 if op .applied {
861861 continue
@@ -865,6 +865,8 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
865865 }
866866 s .stateObjects [addr ].updateRoot ()
867867 }
868+ s .StorageUpdates += time .Since (start )
869+
868870 // Now we're about to start to write changes to the trie. The trie is so far
869871 // _untouched_. We can check with the prefetcher, if it can give us a trie
870872 // which has the same root, but also has some content loaded into it.
@@ -1151,6 +1153,7 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er
11511153 return common.Hash {}, err
11521154 }
11531155 // Handle all state updates afterwards
1156+ start := time .Now ()
11541157 for addr , op := range s .mutations {
11551158 if op .isDelete () {
11561159 continue
@@ -1179,13 +1182,15 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er
11791182 storageTrieNodesDeleted += deleted
11801183 }
11811184 }
1185+ s .StorageCommits += time .Since (start )
1186+
11821187 if codeWriter .ValueSize () > 0 {
11831188 if err := codeWriter .Write (); err != nil {
11841189 log .Crit ("Failed to commit dirty codes" , "error" , err )
11851190 }
11861191 }
11871192 // Write the account trie changes, measuring the amount of wasted time
1188- start : = time .Now ()
1193+ start = time .Now ()
11891194
11901195 root , set , err := s .trie .Commit (true )
11911196 if err != nil {
0 commit comments