filecoin-project / go-amt-ipld

Implementation of an array mapped trie using go and ipld
Other
9 stars 15 forks source link

Improve "dirty" signal for Flush operations #27

Closed rvagg closed 3 years ago

rvagg commented 4 years ago

A Flush() will proceed down the graph and perform both serialization and an IpldStore#Put() on every node that has either an expLinks or expValues array. This is safe because those are always created when mutating. But it's not efficient because they are also created when reading node data. A get will result in creating both expLinks and expValues all the way down to the relevant leaf. So load + get + flush is going to result in saves of all nodes on the path from the root to that value. ForEach, ForEachAt and FirstSetIndex is going to do the same thing.