Skip to content
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

The current RleTree uses too much memory to represent the state of the text #8

Closed
zxch3n opened this issue Nov 1, 2022 · 0 comments

Comments

@zxch3n
Copy link
Member

zxch3n commented Nov 1, 2022

Because bumpalo cannot deallocate, we may waste a lot of space if we use bumpalo to represent the state of text/list.

For example, after applying the Automerge paper dataset, the RleTree has

  • len=104852
  • InternalNodes=264
  • LeafNodes=1124
  • Elements=5755
  • Bytes(bump.allocated_bytes())=2095872

It takes about 2MB to represent the state. However, each node only has 80 bytes, and each element only takes 8 bytes.

Solutions

  • Option 1: Make Bump a generic allocator in RleTreeTrait
  • Option 2: Use another data structure to represent the state

Option 1 may be dirty and inefficient because we also need to wrap the type for the allocated element.

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