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 2 #4 0.010.01?432  0% 0% 100% 0%
 Python 2 #3 0.010.01?431  0% 0% 100% 0%
 Python 2 #3 0.010.01?431  0% 100% 0% 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  50% 0% 100% 0%
 Python 2 #5 0.010.02?455  100% 0% 100% 0%
 Python development version #6 0.020.02?878  50% 100% 0% 0%
 Python development version #5 0.010.02?458  0% 33% 100% 0%
 Python development version #5 0.010.02?458  0% 0% 0% 100%
 Python development version #4 0.010.02?449  50% 0% 50% 0%
 Python development version #5 0.010.02?458  0% 50% 100% 0%
 Python development version #4 0.010.02?449  100% 0% 0% 0%
 Python development version #4 0.020.02?449  0% 0% 100% 0%
 Python 2 #4 0.010.02?432  100% 0% 0% 100%
 Python development version #6 0.020.02?878  0% 0% 100% 0%
 Python development version #6 0.020.02?878  0% 0% 100% 0%
 Python development version #3 0.020.02?410  0% 0% 0% 100%
 Python 3 #5 0.020.02?458  0% 0% 0% 75%
 Python 3 #4 0.020.02?449  0% 0% 100% 0%
 Cython #5 0.020.02?458  0% 0% 0% 100%
 Python development version #3 0.020.02?410  0% 0% 100% 0%
 Python 3 #4 0.020.02?449  100% 0% 0% 33%
 Cython #5 0.020.02?458  100% 0% 0% 0%
 Cython #4 0.020.02?449  0% 0% 0% 67%
 Python 3 #5 0.020.02?458  0% 0% 0% 100%
 Cython #4 0.020.02?449  0% 0% 0% 100%
 Cython #5 0.020.02?458  0% 0% 100% 0%
 Cython #4 0.020.02?449  100% 0% 0% 0%
 Python development version #3 0.020.03?410  0% 0% 67% 0%
 Python 3 #6 0.020.03?878  0% 0% 100% 0%
 Python 3 #5 0.020.03?458  25% 0% 0% 100%
 Python 3 #6 0.020.03?878  0% 100% 0% 33%
 Python 3 #4 0.020.03?449  0% 0% 33% 100%
 Python 3 #3 0.030.03?410  0% 25% 100% 0%
 Python 3 #3 0.030.03?410  0% 0% 100% 0%
 Cython #3 0.030.03?410  25% 100% 25% 33%
 Cython #3 0.030.03?410  0% 0% 100% 33%
 Cython #3 0.030.03?410  0% 100% 0% 0%
 Python 3 #3 0.030.03?410  0% 100% 0% 0%
 Nuitka #5 0.030.03?458  100% 0% 0% 0%
 Nuitka #5 0.030.03?458  100% 0% 0% 0%
 Nuitka #4 0.030.03?449  0% 0% 0% 75%
 Nuitka #6 0.030.03?878  0% 0% 0% 100%
 Nuitka #5 0.030.03?458  0% 0% 0% 100%
 Nuitka #6 0.030.03?878  0% 0% 67% 0%
 Nuitka #4 0.030.03?449  0% 0% 0% 100%
 Nuitka #4 0.030.03?449  100% 50% 0% 0%
 Nuitka #6 0.030.03?878  25% 100% 25% 0%
 Nuitka #3 0.030.03?410  0% 0% 0% 100%
 Nuitka #3 0.030.03?410  100% 0% 0% 0%
 Nuitka #3 0.030.03?410  100% 0% 0% 0%
 Python 3 #6 0.030.04?878  67% 25% 100% 0%
 Pyston #5 0.050.05?455  0% 0% 17% 100%
 Pyston #5 0.050.05?455  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% 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 #3 0.080.08?431  0% 0% 100% 0%
 PyPy 2 #4 0.080.08?432  20% 0% 11% 100%
 PyPy 3 #5 0.080.09?458  0% 0% 100% 0%
 PyPy 2 #4 0.080.09?432  100% 13% 11% 0%
 PyPy 3 #4 0.080.09?449  100% 0% 11% 10%
 PyPy 2 #5 0.080.09?455  11% 11% 100% 11%
 PyPy 2 #4 0.090.09?432  100% 27% 0% 20%
 PyPy 2 #3 0.090.09?431  100% 11% 13% 0%
 PyPy 3 #4 0.090.09?449  0% 0% 0% 90%
 PyPy 3 #5 0.090.09?458  44% 11% 11% 100%
 PyPy 3 #5 0.090.09?458  100% 11% 11% 20%
 PyPy 3 #6 0.090.09?878  20% 0% 0% 89%
 PyPy 3 #6 0.090.09?878  0% 0% 100% 0%
 PyPy 2 #3 0.090.09?431  11% 11% 0% 91%
 PyPy 3 #4 0.090.09?449  10% 11% 0% 100%
 PyPy 3 #6 0.090.09?878  10% 11% 0% 100%
 PyPy 2 #5 0.090.10?455  20% 29% 100% 30%
 PyPy 2 #5 0.100.10?455  100% 45% 40% 13%
 Graal #6 0.110.11?878  8% 8% 91% 9%
 Graal #6 0.110.11?878  0% 27% 64% 33%
 Graal #6 0.110.12?878  91% 8% 0% 0%
 PyPy 3 #3 0.170.17?410  50% 6% 0% 44%
 PyPy 3 #3 0.170.17?410  0% 6% 0% 100%
 PyPy 3 #3 0.170.17?410  6% 11% 100% 6%
 Graal #3 0.770.67345,064410  20% 99% 3% 1%
 Graal #3 0.770.67344,864410  23% 1% 0% 100%
 Graal #3 0.780.68341,560410  4% 15% 100% 7%
 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
RustPython 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