Skip to content
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

Use ByteBuffer wrapper instead of LSB protocol #290

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

athos
Copy link
Member

@athos athos commented Nov 14, 2023

This PR is the first step of #289.

It replaces the use of ByteBuffer as an LSB protocol implementation with a new thin wrapper utility for ByteBuffer.

The modification policy here is to use the bare ByteBuffer methods whenever possible. The new wrapper namespace only collects functions that do what a single method of ByteBuffer cannot do. Most of the implementation code comes from the implementation of the LSB protocol.

@athos athos self-assigned this Nov 14, 2023
@athos athos requested review from alumi and a team as code owners November 14, 2023 07:17
@athos athos requested review from ToshimitsuArai and removed request for a team November 14, 2023 07:17
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (b72d8a9) 88.28% compared to head (2e027f0) 88.33%.

Files Patch % Lines
src/cljam/io/util/byte_buffer.clj 95.34% 2 Missing ⚠️
src/cljam/io/bcf/reader.clj 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #290      +/-   ##
==========================================
+ Coverage   88.28%   88.33%   +0.04%     
==========================================
  Files          80       81       +1     
  Lines        6985     7028      +43     
  Branches      495      495              
==========================================
+ Hits         6167     6208      +41     
- Misses        323      325       +2     
  Partials      495      495              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@athos athos changed the title Feature/byte buffer Use ByteBuffer wrapper instead of LSB protocol Nov 15, 2023
@athos
Copy link
Member Author

athos commented Nov 15, 2023

Added accidentally omitted docstrings.

@athos
Copy link
Member Author

athos commented Nov 15, 2023

Added some code to benchmark the performance of the BCF reader, and I've confirmed that the changes don't degrade the performance of the BAM/BCF readers:

  • before
decode-bam-alignment-long-bench (sam_bench.clj:51)

  ["/Users/sohta/work/src/github.com/chrovis/cljam/.cavia/large.bam"]
  time: 21.659904 sec, sd: 62.121323 ms

decode-large-bcf-bench (vcf_bench.clj:14)

  ["/Users/sohta/work/src/github.com/chrovis/cljam/.cavia/large.bcf"]
  time: 24.589088 sec, sd: 515.149512 ms
  • after
decode-bam-alignment-long-bench (sam_bench.clj:51)

  ["/Users/sohta/work/src/github.com/chrovis/cljam/.cavia/large.bam"]
  time: 19.811300 sec, sd: 63.591633 ms

decode-large-bcf-bench (vcf_bench.clj:14)

  ["/Users/sohta/work/src/github.com/chrovis/cljam/.cavia/large.bcf"]
  time: 24.433835 sec, sd: 878.578249 ms

@athos athos force-pushed the feature/byte-buffer branch from bab0ae8 to 2e027f0 Compare November 15, 2023 21:55
@athos
Copy link
Member Author

athos commented Nov 16, 2023

Rebased onto the latest master.

Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 and thank you for adding the benchmarking codes!

@athos
Copy link
Member Author

athos commented Dec 4, 2023

@ToshimitsuArai Just a reminder, if you have any feedback on the PR, feel free to let me know!

Copy link
Contributor

@ToshimitsuArai ToshimitsuArai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for being late reviewing, I just forget it and thank you for remind🙇‍♂️
LGTM and thanks for faster 👍

@ToshimitsuArai ToshimitsuArai merged commit d68c01d into master Dec 5, 2023
17 checks passed
@athos
Copy link
Member Author

athos commented Dec 5, 2023

Thank you both for taking the time to review this!

@athos athos deleted the feature/byte-buffer branch December 5, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants