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

FlatGFA: Set up for in-place mutation #155

Merged
merged 10 commits into from
Mar 18, 2024
Merged

FlatGFA: Set up for in-place mutation #155

merged 10 commits into from
Mar 18, 2024

Conversation

sampsyo
Copy link
Collaborator

@sampsyo sampsyo commented Mar 18, 2024

There is no actual externally useful change here, but this changes the file format to allow for "gaps," i.e., to have more space for elements in the GFA representation than we have actual values. This way, we can feasibly mutate graphs in place (adding and removing elements), up to the limit of the pre-allocated regions.

To make this work, I used the tinyvec crate's SliceVec type, which works like Vec but is backed by a fixed-size slice (which may, in our case, come from an mmap'd file). Some type and lifetime trickery was required to make our backing stores polymorphic over whether they use SliceVec or Vec, but now they are. (The new Pool abstraction covers both cases.)

So far, this is hooked up for reading only. Next, I will add pre-allocated file emission, which will require guessing the necessary sizes.

@sampsyo sampsyo merged commit f73db4c into main Mar 18, 2024
3 checks passed
@sampsyo sampsyo deleted the polbin-prealloc branch March 18, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant