-
Notifications
You must be signed in to change notification settings - Fork 12
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
Replace remaining LSB protocol implementations with ordinary functions #293
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #293 +/- ##
==========================================
- Coverage 88.31% 87.94% -0.37%
==========================================
Files 81 83 +2
Lines 7058 7192 +134
Branches 488 488
==========================================
+ Hits 6233 6325 +92
- Misses 337 379 +42
Partials 488 488 ☔ View full report in Codecov by Sentry. |
231298a
to
a2a001d
Compare
8fb577a
to
a8993b8
Compare
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.
LGTM 👍
Now that cljam.io.util.lsb
is no longer used, we can either remove the ns and cut a new release 0.9.0
, or deprecate functions in it and keep the version 0.8.5
.
I've searched our internal repositories and found just one function depending on the ns, so I think it's almost safe to remove it. Could you tell me what you think about this?
a8993b8
to
61749bb
Compare
61749bb
to
8612caa
Compare
I’d prefer more graceful deprecation, so I've added the I also added another commit to add notes that warn use of the new lsb namespaces to discourage undesired abuse of them from outside cljam in the future. |
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.
LGTM 👍
This is the last step of #289.
This PR adds the following implementations of LSB protocols as ordinary functions:
DataInput
(defined incljam.io.util.lsb.data-io
)InputStream
(defined incljam.io.util.lsb.io-stream
)OutputStream
(defined incljam.io.util.lsb.io-stream
)The
cljam.io.util.lsb
namespace has some other implementations as well, but they are no longer in use.The following table shows the implementations used before and after the change:
reader
cljam.io.bam.core
DataInputStream
(DataInput
)cljam.io.util.lsb.data-io
cljam.io.bam.reader
DataInputStream
(DataInput
)cljam.io.util.lsb.data-io
cljam.io.bam-index.reader
FileInputStream
(InputStream
)cljam.io.util.lsb.io-stream
cljam.io.bcf.reader
BGZFInputStream
(InputStream
)cljam.io.util.lsb.io-stream
cljam.io.bigwig
RandomAccessFile
(DataInput
)cljam.io.util.lsb.data-io
cljam.io.csi
DataInputStream
(DataInput
)cljam.io.util.lsb.data-io
cljam.io.tabix
DataInputStream
(DataInput
)cljam.io.util.lsb.data-io
writer
cljam.algo.convert
ByteBuffer
cljam.io.util.lsb.io-stream
cljam.io.bam.encoder
DataOutputStream
cljam.io.util.lsb.io-stream
cljam.io.bam.writer
DataOutputStream
cljam.io.util.lsb.io-stream
cljam.io.bam-index.writer
DataOutputStream
cljam.io.util.lsb.io-stream
cljam.io.bcf.writer
DataOutputStream
cljam.io.util.lsb.io-stream
cljam.io.csi
DataOutputStream
cljam.io.util.lsb.io-stream
I've confirmed that this change doesn't have significant negative impact on the performance of the related readers/writers (This PR also includes a tweak of the benchmark code for the BAM reader to make it more stable and reliable by reducing extra overhead of sequence allocation in the benchmark code itself):
5.835351 s
5.677128 s
12.149866 s
12.076689 s
6.469314 s
6.468553 s
1.641983 s
1.676683 s
cljam.algo.convert
182.333152 ms
180.971159 ms
84.117612 μs
83.471144 μs
22.210736 μs
21.966407 μs
127.886597 μs
127.627769 μs
24.434094 μs
25.902402 μs
See below for more about the benchmarking details:
benchmarking details
For those with existing benchmark code, I benchmarked them using the following
lein libra
commands:lein libra :only cljam.io.sam-bench/decode-bam-alignment-long-bench
lein libra :only cljam.io.sam-bench/encode-alignment-long-bench
lein libra :only cljam.io.vcf-bench/decode-variant-large-bcf-bench
lein libra :only cljam.io.vcf-bench/encode-variant-large-bcf-bench
cljam.algo.convert
lein libra :only cljam.algo.convert-bench
For the others, I used the following tiny benchmark code: