8000 Don't serialize or deserialize nodes · Issue #804 · ava-labs/firewood · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Don't serialize or deserialize nodes #804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rkuris opened this issue Feb 24, 2025 · 0 comments
Open

Don't serialize or deserialize nodes #804

rkuris opened this issue Feb 24, 2025 · 0 comments

Comments

@rkuris
Copy link
Collaborator
rkuris commented Feb 24, 2025

To read data, we currently read nodes (starting at the root) and for each node we construct a BranchNode object. Then we only read one child address out of that. It would be more efficient to read the node serialized and have a method that figures out from the serialized object what the child address is at a given offset.

One issue with this today is that the node is compacted very tightly. It might make sense to relax this compaction some so that we don't have to pay the cost of serializing. For example, the branch nodes could have the list of children as an array at the end rather than packing empty items together.

It might also be good for the actual data for the node to be in a Cow which could facilitate using memory mapped files for nodes stored on disk and a heap arena for nodes stored in memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0