-
Notifications
You must be signed in to change notification settings - Fork 80
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
[MRG] speed up SeqToHashes
translate
#1946
Conversation
Codecov Report
@@ Coverage Diff @@
## latest #1946 +/- ##
=======================================
Coverage 82.93% 82.94%
=======================================
Files 125 125
Lines 13755 13759 +4
Branches 1877 1877
=======================================
+ Hits 11408 11412 +4
Misses 2075 2075
Partials 272 272
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Ready for review @ctb @luizirber before and after timing in #1945 |
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.
This is great! But I have to admit I don't understand why the new code is so much faster 😭 . Could you maybe add some comments?
@ctb sure! Here I am explaining the tradeoff of using
sourmash/src/core/src/signature.rs Line 226 in 6f5245b
sourmash/src/core/src/signature.rs Lines 341 to 348 in 6f5245b
|
ahh, got it! but - is this something that is worth adding in comments in the actual code, do you think? |
(I tend to think that something that required the amount of discussion this issue had is worth documenting in the code.) |
I spent sometime to understand what I was doing in the code, so, yes I will add some comments. |
@ctb I think it's ready now. |
cool! I mean, it's been approved for a while, but I can do the button push ;) |
@ctb oh, ok :D next time I will merge when approved :) Thank you! |
Vectors are very good in insertions, not in deletion. In #1938 I replaced
Vec
withVecDeque
because I was popping out a hash per iteration. This deletion is very slow inVec
because it shifts all the elements in memory, while it's very fast inVecDeque
.In this PR I am reverting back to
Vec
and replacing all the parts that require deletion or popping by smoother code. Now there's no need for usingVecDeque
.Resolves #1945