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.
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.
Read VCF headers with the
ManagedQuery
API which:std::vector<T>::reserve()
instead of allocating and populating user buffers. TheManagedQuery
uses the actual amount of memory required, while the previous implementation used the entire estimated buffer size, which was pessimistic.This PR also resolves an edge case where reading the first sample would fail if the first sample was previously deleted.