reverse-complement benchmark N=1,000

Each chart bar shows how many times slower, one ↓ reverse-complement program was, compared to the fastest program.

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.

Column × shows how many times more each program used compared to the benchmark program that used least.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 Python 2 #5 0.01?455  
 Python 2 #5 0.010.01?455  0% 100% 0% 0%
 Python 2 #4 0.010.01?432  0% 100% 0% 0%
 Python 2 #3 0.010.01?431  100% 0% 0% 0%
 Python 2 #4 0.010.01?432  0% 100% 50% 0%
 Python 2 #5 0.010.01?455  0% 0% 100% 0%
 Python 2 #3 0.010.01?431  50% 50% 100% 0%
 Python 2 #4 0.010.01?432  0% 100% 0% 0%
 Python 2 #3 0.010.01?431  0% 0% 100% 0%
 Python development version #6 0.020.02?878  100% 0% 0% 0%
 Python development version #4 0.020.02?449  0% 0% 100% 0%
 Python development version #4 0.020.02?449  0% 0% 0% 100%
 Python development version #6 0.020.02?878  100% 0% 0% 0%
 Python development version #4 0.020.02?449  100% 0% 50% 0%
 Python development version #5 0.020.02?458  0% 33% 0% 100%
 Python development version #6 0.020.02?878  0% 100% 0% 0%
 Python development version #5 0.020.02?458  0% 0% 0% 100%
 Python development version #5 0.020.02?458  0% 100% 33% 0%
 Cython #4 0.020.02?449  0% 0% 0% 100%
 Cython #4 0.020.02?449  0% 0% 0% 100%
 Cython #5 0.020.02?458  50% 0% 0% 100%
 Cython #5 0.020.02?458  100% 0% 0% 0%
 Python development version #3 0.020.02?410  0% 0% 0% 100%
 Cython #4 0.020.02?449  0% 0% 0% 100%
 PyPy 2 #5 0.020.02?455  100% 0% 0% 0%
 PyPy 2 #5 0.020.02?455  0% 25% 100% 0%
 PyPy 2 #4 0.020.02?432  0% 100% 0% 0%
 PyPy 2 #4 0.020.02?432  0% 33% 100% 0%
 PyPy 2 #5 0.020.02?455  0% 0% 100% 0%
 Cython #5 0.020.02?458  0% 100% 25% 0%
 Python development version #3 0.020.03?410  100% 0% 33% 0%
 PyPy 2 #3 0.020.03?431  0% 0% 0% 100%
 PyPy 2 #3 0.020.03?431  0% 67% 33% 25%
 Python 3 #4 0.020.03?449  33% 0% 100% 0%
 Python 3 #6 0.020.03?878  0% 0% 0% 100%
 PyPy 2 #3 0.020.03?431  0% 0% 0% 100%
 PyPy 2 #4 0.020.03?432  0% 100% 0% 0%
 Python 3 #6 0.020.03?878  25% 25% 25% 67%
 Python 3 #4 0.030.03?449  0% 75% 25% 33%
 Python 3 #4 0.030.03?449  0% 0% 100% 25%
 Python 3 #6 0.030.03?878  0% 33% 0% 67%
 Python 3 #5 0.030.03?458  0% 100% 33% 0%
 Python 3 #5 0.030.03?458  0% 100% 0% 0%
 Cython #3 0.030.03?410  33% 0% 0% 100%
 Python development version #3 0.030.03?410  0% 100% 0% 0%
 Python 3 #3 0.030.03?410  0% 0% 0% 100%
 Python 3 #3 0.030.03?410  0% 0% 0% 100%
 PyPy 3 #5 0.030.03?458  100% 0% 0% 0%
 PyPy 3 #4 0.030.03?449  0% 0% 0% 75%
 Cython #3 0.030.03?410  0% 0% 100% 25%
 PyPy 3 #5 0.030.03?458  100% 0% 0% 0%
 PyPy 3 #4 0.030.03?449  0% 0% 25% 100%
 PyPy 3 #6 0.030.03?878  100% 0% 0% 0%
 PyPy 3 #6 0.030.03?878  0% 0% 0% 100%
 Python 3 #5 0.030.03?458  25% 100% 0% 0%
 PyPy 3 #4 0.030.03?449  25% 0% 0% 100%
 PyPy 3 #5 0.030.03?458  40% 25% 0% 100%
 Cython #3 0.030.03?410  0% 100% 25% 0%
 PyPy 3 #6 0.030.03?878  0% 0% 0% 100%
 Nuitka #4 0.040.04?449  0% 0% 0% 100%
 Nuitka #5 0.040.04?458  0% 25% 0% 100%
 Nuitka #4 0.040.04?449  0% 100% 0% 0%
 Nuitka #5 0.040.04?458  0% 80% 0% 0%
 Nuitka #4 0.040.04?449  0% 100% 25% 0%
 Nuitka #6 0.040.04?878  0% 0% 0% 100%
 Nuitka #5 0.040.04?458  0% 0% 100% 0%
 Nuitka #6 0.040.04?878  0% 0% 20% 83%
 Nuitka #3 0.040.04?410  100% 0% 0% 0%
 Nuitka #3 0.040.04?410  83% 0% 20% 20%
 Nuitka #6 0.040.04?878  33% 50% 0% 100%
 Nuitka #3 0.040.05?410  20% 20% 0% 100%
 Python 3 #3 0.040.05?410  20% 0% 75% 0%
 PyPy 3 #3 0.050.05?410  0% 20% 83% 0%
 PyPy 3 #3 0.040.05?410  0% 0% 100% 0%
 PyPy 3 #3 0.050.05?410  25% 0% 0% 50%
 Pyston #5 0.050.05?455  0% 0% 17% 100%
 Pyston #5 0.050.05?455  100% 0% 0% 0%
 Pyston #4 0.050.05?432  100% 0% 0% 0%
 Pyston #5 0.050.05?455  100% 0% 0% 17%
 Pyston #4 0.050.05?432  100% 0% 0% 0%
 Pyston #4 0.050.05?432  100% 14% 17% 0%
 Pyston #3 0.060.06?431  17% 0% 100% 0%
 Pyston #3 0.060.06?431  17% 14% 100% 29%
 Pyston #3 0.060.06?431  100% 17% 29% 17%
 Jython #4 2.731.21134,856432  45% 51% 49% 83%
 Jython #4 2.821.23172,892432  83% 63% 50% 40%
 Jython #4 2.801.24169,836432  46% 52% 39% 94%
 Jython #3 2.931.25178,732431  56% 73% 50% 63%
 Jython #3 3.001.26184,704431  61% 52% 83% 49%
 Jython #5 2.911.26170,296455  96% 50% 52% 40%
 Jython #5 2.861.27170,772455  52% 44% 95% 53%
 Jython #5 2.891.29173,704455  43% 78% 65% 55%
 Jython #3 2.891.29163,600431  56% 60% 78% 39%
missing benchmark programs
IronPython No program
Shedskin No program
Numba No program
MicroPython No program
Grumpy No program

 reverse-complement benchmark : Read DNA sequences - write their reverse-complement

diff program output for this 10KB input file (generated with the fasta program N = 1000) with this output file to check your program is correct before contributing.

We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.

We use the FASTA file generated by the fasta benchmark as input for this benchmark. Note: the file may include both lowercase and uppercase codes.

Each program should

We use these code complements:

code  meaning   complement
A    A                   T
C    C                   G
G    G                   C
T/U  T                   A
M    A or C              K
R    A or G              Y
W    A or T              W
S    C or G              S
Y    C or T              R
K    G or T              M
V    A or C or G         B
H    A or C or T         D
D    A or G or T         H
B    C or G or T         V
N    G or A or T or C    N

"by knowing the sequence of bases of one strand of DNA we immediately know the sequence of the DNA strand which will bind to it, this strand is called the reverse complement"
DNA: Structure and Function

Revised BSD license

  Home   Conclusions   License   Play