sourmash-bio / sourmash

Quickly search, compare, and analyze genomic and metagenomic data sets.
http://sourmash.readthedocs.io/en/latest/
Other
476 stars 79 forks source link

fix: Avoid re-calculating md5sum on clone and conversion to KmerMinHashBTree #3385

Closed luizirber closed 1 week ago

luizirber commented 1 week ago

While debugging https://github.com/sourmash-bio/sourmash_plugin_branchwater/issues/503 the flamegraph showed ~26% of the time was spent on calculating MD5.

WHY????

Turns out cloning and converting to KmerMinHash to KmerMinHashBTree triggered recalculation of the MD5 sum, even if it was already present (or... not needed). Oops!

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.46%. Comparing base (e86c8a8) to head (d488294). Report is 1 commits behind head on latest.

Files with missing lines Patch % Lines
src/core/src/sketch/minhash.rs 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## latest #3385 +/- ## ========================================== - Coverage 86.47% 86.46% -0.01% ========================================== Files 137 137 Lines 16089 16092 +3 Branches 2219 2219 ========================================== + Hits 13913 13914 +1 - Misses 1869 1871 +2 Partials 307 307 ``` | [Flag](https://app.codecov.io/gh/sourmash-bio/sourmash/pull/3385/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sourmash-bio) | Coverage Δ | | |---|---|---| | [hypothesis-py](https://app.codecov.io/gh/sourmash-bio/sourmash/pull/3385/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sourmash-bio) | `25.43% <ø> (ø)` | | | [python](https://app.codecov.io/gh/sourmash-bio/sourmash/pull/3385/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sourmash-bio) | `92.40% <ø> (ø)` | | | [rust](https://app.codecov.io/gh/sourmash-bio/sourmash/pull/3385/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sourmash-bio) | `62.23% <75.00%> (-0.03%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sourmash-bio#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.