Closed KristofferC closed 5 years ago
Re-running it and the performance difference is quite small now.
Not sure whether this is permissible, but one could turn the string input into a UInt64[]
on parsing (two bits per entry) and move the sliding window by simple shifts (need to fill in new content every 32 - length steps). If encoding of a subsequence as an integer is permissible, then shifting the window is surely permissible as well?
You only need to subtract the first nucleotide in the chain and the most recently read one?
So if you have k = "GA"
and you read a T
you do something like k - 'G' + 'T'
. Should be an ok optimization.
Before:
After: