Skip to content

BufferedSamRecords::new() reserves 10,000 records per read #280

Description

@BenjaminDEMAILLE

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions