BufferedSamRecords::new() in src/io/sam.rs pre-allocates capacity for 10,000 records, but it is created per read, not per batch. That is a large allocation (and free) on every read, for a buffer that typically holds 1 to a few records.
Found while working on #278.
Fix: size it for the per-read case (small or zero capacity), and keep any large reservation at the batch level.
Tracking: #277
🤖 Generated with Claude Code
BufferedSamRecords::new()insrc/io/sam.rspre-allocates capacity for 10,000 records, but it is created per read, not per batch. That is a large allocation (and free) on every read, for a buffer that typically holds 1 to a few records.Found while working on #278.
Fix: size it for the per-read case (small or zero capacity), and keep any large reservation at the batch level.
Tracking: #277
🤖 Generated with Claude Code