Code improvement for DNA reverse complement?

aberba via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 25 14:15:13 PDT 2017


On Friday, 19 May 2017 at 07:46:13 UTC, Stefan Koch wrote:
> On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
>> I am solving this problem http://rosalind.info/problems/revc/ 
>> as an exercise to learn D. This is my solution:
>>
>> https://dpaste.dzfl.pl/8aa667f962b7
>>
>> Is there some D tricks I can use to make the 
>> `reverseComplement` function more concise and speedy? Any 
>> other comments for improvement of the whole solution are also 
>> much appreciated.
>
> I think doing a switch or even a if-else chain would be faster 
> then using an AA.

As part of your work on newCTFE, you are in a position to write a 
book titled "Fast D", about code that compiles, execute fast and 
efficiently.


More information about the Digitalmars-d-learn mailing list