From c9caaa30fad1a800c837a71bacccdfd34db9eaaa Mon Sep 17 00:00:00 2001 From: shakezula Date: Wed, 19 Jul 2023 13:22:24 -0600 Subject: [PATCH] [fixup] adds optimize comment to save function --- persistence/trees/trees.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/persistence/trees/trees.go b/persistence/trees/trees.go index 69a71e187..ce60c7daf 100644 --- a/persistence/trees/trees.go +++ b/persistence/trees/trees.go @@ -299,6 +299,8 @@ func (t *treeStore) Rollback() { // save commits any pending changes to the trees and serializes the treeStore to a WorldState object // with new readers and writers. +// OPTIMIZE: Consider saving only the root hash of each tree and the tree directory here and then +// load the trees up in Rollback instead of setting them up here. func (t *treeStore) save() (*Worldstate, error) { if err := t.Commit(); err != nil { return nil, err