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 #3 0.01?431  
 Python development version #4 0.01?449  
 Python 2 #4 0.010.01?432  0% 0% 100% 0%
 Python 2 #3 0.010.01?431  0% 100% 0% 0%
 Python 2 #3 0.010.01?431  0% 0% 100% 0%
 Python 2 #4 0.010.01?432  0% 50% 0% 100%
 Python 2 #5 0.010.01?455  0% 0% 50% 0%
 Python 2 #5 0.010.02?455  100% 0% 100% 0%
 Python 2 #5 0.010.02?455  50% 0% 100% 0%
 Python development version #4 0.010.02?449  100% 50% 0% 0%
 Python development version #5 0.010.02?458  100% 50% 0% 0%
 Python development version #5 0.010.02?458  100% 0% 0% 0%
 Python development version #4 0.010.02?449  0% 50% 100% 33%
 Python development version #6 0.020.02?878  50% 0% 0% 0%
 Python 2 #4 0.010.02?432  100% 0% 0% 100%
 Python development version #5 0.010.02?458  0% 0% 0% 0%
 Python development version #6 0.020.02?878  0% 0% 100% 0%
 Python development version #6 0.020.02?878  0% 50% 33% 0%
 Python 3 #5 0.020.02?458  0% 0% 100% 33%
 Python 3 #4 0.020.02?449  0% 0% 100% 0%
 Python 3 #5 0.020.02?458  33% 33% 100% 0%
 Python 3 #4 0.020.02?449  0% 0% 100% 33%
 Python 3 #6 0.020.02?878  0% 0% 75% 0%
 Python development version #3 0.020.02?410  0% 0% 0% 100%
 Python 3 #4 0.020.02?449  0% 0% 100% 0%
 Python development version #3 0.020.02?410  33% 33% 0% 100%
 Python 3 #6 0.020.02?878  0% 0% 100% 0%
 Python 3 #5 0.020.02?458  0% 0% 100% 33%
 Python 3 #6 0.020.02?878  0% 0% 0% 75%
 Python development version #3 0.020.02?410  0% 0% 100% 0%
 Cython #5 0.020.02?458  0% 100% 0% 0%
 Cython #4 0.020.02?449  0% 100% 0% 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  0% 0% 0% 100%
 Python 3 #3 0.030.03?410  33% 0% 67% 0%
 Cython #5 0.020.03?458  25% 0% 25% 67%
 Python 3 #3 0.030.03?410  0% 75% 33% 0%
 Python 3 #3 0.030.03?410  0% 100% 33% 0%
 Cython #3 0.030.03?410  0% 100% 0% 0%
 Cython #3 0.030.03?410  0% 0% 100% 0%
 Cython #3 0.030.03?410  50% 0% 100% 0%
 Nuitka #5 0.030.03?458  0% 25% 0% 100%
 Nuitka #5 0.030.03?458  100% 0% 0% 0%
 Nuitka #5 0.030.03?458  100% 0% 0% 0%
 Nuitka #6 0.030.03?878  75% 0% 0% 25%
 Nuitka #4 0.030.03?449  25% 0% 100% 0%
 Nuitka #4 0.030.03?449  0% 0% 100% 0%
 Nuitka #6 0.030.03?878  0% 25% 0% 100%
 Nuitka #3 0.030.03?410  0% 0% 0% 100%
 Nuitka #3 0.030.03?410  0% 0% 0% 100%
 Nuitka #3 0.030.03?410  100% 0% 0% 0%
 Nuitka #6 0.030.03?878  0% 0% 25% 100%
 Nuitka #4 0.030.03?449  0% 0% 0% 100%
 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%
 PyPy 2 #5 0.080.08?455  100% 11% 0% 0%
 PyPy 2 #4 0.080.08?432  11% 0% 0% 100%
 PyPy 2 #3 0.080.08?431  0% 0% 100% 0%
 PyPy 2 #5 0.080.08?455  0% 0% 100% 11%
 PyPy 2 #3 0.080.08?431  11% 13% 0% 100%
 PyPy 3 #5 0.080.08?458  11% 0% 0% 89%
 PyPy 3 #5 0.080.08?458  100% 0% 0% 11%
 PyPy 2 #4 0.080.08?432  0% 89% 0% 0%
 PyPy 3 #4 0.080.09?449  0% 0% 100% 0%
 PyPy 3 #4 0.080.09?449  100% 0% 0% 11%
 PyPy 3 #6 0.080.09?878  0% 100% 0% 0%
 PyPy 3 #6 0.090.09?878  0% 100% 11% 0%
 PyPy 3 #4 0.090.09?449  13% 89% 0% 11%
 PyPy 3 #6 0.080.09?878  100% 0% 0% 0%
 PyPy 3 #5 0.090.09?458  89% 0% 0% 44%
 PyPy 2 #4 0.080.10?432  80% 10% 0% 0%
 Graal #6 0.100.10?878  10% 100% 0% 0%
 Graal #6 0.100.10?878  10% 91% 18% 9%
 Graal #6 0.100.10?878  0% 100% 0% 0%
 PyPy 2 #5 0.080.10?455  80% 10% 9% 0%
 PyPy 2 #3 0.080.10?431  0% 0% 0% 73%
 PyPy 3 #3 0.160.17?410  0% 100% 0% 0%
 PyPy 3 #3 0.170.17?410  100% 0% 6% 6%
 PyPy 3 #3 0.170.18?410  6% 83% 5% 0%
 Graal #3 0.560.46183,736410  64% 24% 24% 17%
 Graal #3 0.570.46183,296410  96% 26% 11% 2%
 Graal #3 0.600.48183,852410  43% 20% 57% 18%
 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