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

Fast ASCII String to LongSequence conversion #81

Closed
wants to merge 1 commit into from

Conversation

jakobnissen
Copy link
Member

@jakobnissen jakobnissen commented Jan 10, 2020

Fast ASCII String to LongSequence conversion

This PR makes it so that if a LongSequence is constructed from a String, or encode_copy!'ed from a String, it detects if the String is an ASCII string. If so, it wraps a byte vector around it and uses the faster vector to LongSequence conversion path.

Edit: Should probably post some benchmarks. Here, I run LongSequence{DNAAlphabet{4}}(st) for varying lengths of string:

Len   Before     After (time in ns)
    0     48        62
    1     60        75
   50    635       134
  150   1863       294
 1000  11630      1164
10000 115815     10220

@TransGirlCodes
Copy link
Member

TransGirlCodes commented Jan 10, 2020

Can this be rebased onto master? Master has all the version2 branch changes now and some more, since v2 got released to the BioJulia registry. It might explain some of the CI failures as well.

@jakobnissen
Copy link
Member Author

Yes sure! I didn't know master had been updated. I'm currently trying to figure out how to generalize it to all alphabets with the trait BioSequences.AsciiAlphabet. But that's probably better left for another PR.

@jakobnissen
Copy link
Member Author

Superseded by #83, which is larger in scope.

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.

None yet

2 participants