-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change SAMTextHeaderCodec to no longer accumulate the entire text of … #1361
Conversation
…the header into memory.
@lbergelson, @jacarey, @yfarjoun: would one of you like to take a look at this? |
Codecov Report
@@ Coverage Diff @@
## master #1361 +/- ##
==============================================
+ Coverage 67.849% 68.199% +0.35%
- Complexity 8283 8601 +318
==============================================
Files 563 564 +1
Lines 33707 34326 +619
Branches 5657 5820 +163
==============================================
+ Hits 22870 23410 +540
- Misses 8659 8721 +62
- Partials 2178 2195 +17
|
FWIW I've checked the lastest |
This looks good, can you also remove the comment that refers to There is also code in picard |
mCurrentLine = mReader.readLine(); | ||
textHeader.append(mCurrentLine).append('\n'); | ||
return mCurrentLine; | ||
this.mCurrentLine = (nextChar == '@') ? mReader.readLine() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if there was a named constant for the magic character/string @
.
fixes #1045 |
@tfenne feel free to merge this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…the header into memory.
Description
Accumulating the entire text of the header into memory is of questionable value and causes a) performance degradation in the best case and b) outright failure in the worst case. In cases where the header text is longer than 2^31 characters the code fails outright.
The changes made simply no longer accumulate the text. Lines that have errors are recorded as validation errors already. And if the full text is really needed, the user can take a look at their input file!
I've also deprecated the methods for getting and setting the entire header text on
SAMFileHeader
.Checklist