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

Reduce memory usage and improve perf when reading VCF headers #631

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

gspowley
Copy link
Member

Read VCF headers with the ManagedQuery API which:

  1. Reduces memory usage by reserving buffer space using std::vector<T>::reserve() instead of allocating and populating user buffers. The ManagedQuery uses the actual amount of memory required, while the previous implementation used the entire estimated buffer size, which was pessimistic.
  2. Improves performance by avoiding populating the estimated buffer size with empty data.

This PR also resolves an edge case where reading the first sample would fail if the first sample was previously deleted.

Copy link

@gspowley gspowley requested a review from awenocur December 11, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants