Expand description
Inline record buffer for samtools-style memory layout.
This module provides a contiguous buffer that stores BAM records inline with pre-computed sort keys, eliminating per-record heap allocations.
Key benefits over Vec<(Key, Record)>:
- Single large allocation instead of millions of small ones
- Better cache locality - sequential memory access
- Sort by index array, not by moving actual record data
- ~24 bytes overhead per record vs ~110 bytes
Structs§
- Packed
Coord Key - Packed sort key for coordinate ordering.
- Record
Buffer - Contiguous buffer for inline record storage.
- Record
Ref - Reference to a record in the buffer (used for sorting).
- Template
Inline Header - Inline header stored before each record in the data buffer. This allows us to use a minimal ref structure while still having fast access to the full sort key.
- Template
Key - Extended key for template-coordinate sorting.
- Template
Record Buffer - Template-coordinate record buffer with inline headers.
- Template
Record Ref - Record reference for template-coordinate sorting with cached key.
Constants§
- TEMPLATE_
HEADER_ SIZE - Size of
TemplateInlineHeaderin bytes.
Functions§
- extract_
coordinate_ key_ inline - Extract coordinate sort key directly from raw BAM bytes.
- parallel_
radix_ sort_ record_ refs - Parallel radix sort for
RecordRefarrays. - parallel_
radix_ sort_ template_ refs - Parallel radix sort for
TemplateRecordRefarrays. - radix_
sort_ record_ refs - Radix sort for
RecordRefarrays using LSD (Least Significant Digit) approach. - radix_
sort_ template_ refs - Radix sort for
TemplateRecordRefarrays using multi-field LSD approach.