Replace flattenTrie by callback #241
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#241
Loading…
Reference in a new issue
No description provided.
Delete branch "removed_flattentrie"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Anthony Fieroni bvbfan@abv.bg
To clarify the intent of this: our present flattenTrie method clones the trie. Each copy of the trie uses hundreds of MB of RAM -- soon to be GB. We then clone it a second time as we copy it into the univalue objects. This PR removes the flattenTrie clone. The flattenTrie is a present part of the normalization fork one-time-upgrade that I would like to avoid.
My preferred solution looks like this:
70e3f94ac8/src/Trie.hpp (L96-L181)
. However, I'm not quite ready to go there yet. This solution is a very safe and easy intermediate step that can be replaced later.I don't really understand the "InterruptionPoint" part of the code. Can you explain a little bit how it works and what its' for? Is it based on some design pattern I can read about somewhere?
EDIT: Ok after reading a bit more.. I think I understand but it seems like we don't need this feature because we iterate through everything? Is this needed for some future use case?
Yes, we iterate on whole trie right now, but we can check shutdown signal in.
Yep, this approach combines features of std::for_each and std::find_if in one. It gives flexibility and performance, since we are at ~480k height iteration on whole trie is expensive.