Repository navigation
Conversation
setAttribute(tag, null) marked a BAMRecord's stored variable-length bytes stale even when the record had no such tag, so writing it back to BAM decoded and re-encoded the name, CIGAR, bases, qualities and tags although nothing had changed. Duplicate marking clears DT on every read, so every read paid that. Removing an absent tag now leaves the bytes alone. In BamRecordCodecBenchmark (3 forks a side) re-encoding after such a removal fell from 75.2 to 35.9 ms for 200,000 150 bp reads with typical tags (-52%; the remaining cost is decoding the tags to look for it) and from 16.6 to 1.85 ms for 2,000 15 kb reads (-89%). Setting a tag moved +3.7% (t=2.3) and an untouched re-encode +3.5% (t=0.9), within this machine's noise.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing a tag a BAM record doesn't have no longer makes the record re-encode on write. Stacked on #1954, which adds the benchmark.
BAMRecord.setAttribute(tag, null)marked the stored variable-length bytes stale even when the tag was absent, so writing the record back to BAM decoded and re-encoded name, CIGAR, bases, qualities and tags. Duplicate marking clearsDTon every read.BamRecordCodecBenchmark, 3 forks a side: re-encoding after such a removal 75.2 → 35.9 ms for 200,000 150 bp reads (-52%; what remains is decoding the tags to look for it) and 16.6 → 1.85 ms for 2,000 15 kb reads (-89%). Controls: tag set +3.7% (t=2.3), untouched +3.5% (t=0.9), on a machine where most forks reported outside load.BAMRecordTest, asBAMRecordhad no test class.