Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to try to summarize my understanding of this to make sure I've got it correct:
child-entry
takes a node and returns a tuple of the the first flake it addresses and the node itself. This changeunresolve
s the node itself so it won't carry around the:children
or:flakes
references.Is it to reduce the size of the node we need to pass around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This code is mainly used when the database is re-indexed. In that case, the entire index tree is loaded into memory, node by node, and rebalanced. Without this change, the result of the indexing process would hold the all the data from an index in memory, thus eliminating the gains from processing the index node by node instead of all at once. This change instead keeps a pointer to the top level child nodes on disk, and those child nodes keep pointers to their children, and so on. The whole benefit of this change is memory efficiency for the indexing process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the explanation, that makes perfect sense.