reverse-complement benchmark ≈240MB N=25,000,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
1.0C gcc #2 0.840.58250,384741  14% 76% 21% 41%
1.2C gcc 1.050.70496,8361867  13% 87% 32% 23%
1.3C++ g++ #4 1.150.75247,0082275  11% 87% 30% 29%
1.5OCaml #3 0.8912,6441314  52% 57% 83% 67%
1.8Fortran Intel 1.021.04246,4601013  1% 0% 1% 100%
2.0Ada 2005 GNAT #2 1.551.15200,6163220  1% 41% 1% 94%
2.2C++ g++ #2 1.291.29246,9961082  0% 3% 1% 100%
2.2C gcc #4 1.291.29125,132704  0% 1% 3% 100%
2.3C++ g++ #3 1.321.32124,956810  2% 3% 2% 100%
2.5Haskell GHC #3 1.541.45125,956999  3% 6% 4% 100%
2.8Java  #3 3.161.63296,1361661  77% 24% 39% 58%
2.9OCaml #4 1.661.67127,5802064  0% 1% 1% 100%
2.9Scala #8 2.201.69512,996761  92% 6% 33% 2%
3.0Java  #6 2.011.74513,220745  84% 30% 3% 3%
3.1Go #3 1.791.79163,280543  1% 3% 2% 99%
3.3Go 2.181.91249,5721243  13% 1% 100% 2%
3.4Go #2 1.981.98163,232546  1% 0% 99% 1%
3.5OCaml 2.0625,4481064  6% 26% 66% 61%
3.5Pascal Free Pascal #2 2.062.06124,428751  0% 1% 0% 100%
4.1Scala #4 2.482.41406,492501  2% 2% 98% 5%
4.8Lisp SBCL 2.812.82251,104896  0% 1% 0% 100%
4.9Haskell GHC #2 3.152.85618,320919  77% 5% 27% 5%
5.2C# Mono 3.023.03175,5081099  1% 0% 8% 93%
5.2Java  #4 3.143.04478,080592  3% 98% 2% 3%
5.2Perl #3 3.043.05374,472284  0% 1% 1% 100%
5.3Scala #7 5.463.11797,764949  46% 65% 38% 30%
6.3C++ g++ 3.683.69247,044571  1% 0% 2% 100%
6.9Ada 2005 GNAT 4.034.03125,464885  1% 0% 1% 100%
7.7Racket #2 4.484.48172,5481026  1% 1% 100% 1%
7.7OCaml #2 4.494.50171,972394  0% 16% 84% 0%
7.8Clojure #5 6.634.56562,080727  8% 54% 12% 74%
8.7Clojure 6.435.09405,1641044  11% 6% 98% 12%
11Clojure #4 8.026.50446,884997  49% 8% 11% 58%
11Python 3 #4 6.536.55781,144325  0% 1% 0% 100%
13Java  #7 2.707.31264,9121640  28% 28% 18% 45%
13PHP #2 7.837.85443,496262  0% 100% 0% 0%
14PHP 7.927.95370,544297  0% 13% 88% 0%
14Fortran Intel #2 8.288.30167,656772  0% 0% 0% 100%
16C# Mono #3 9.179.18257,320863  1% 97% 1% 3%
18Ruby #2 10.6110.62127,848255  0% 0% 100% 1%
20Erlang HiPE 21.6611.71762,6001302  80% 40% 26% 40%
23Racket 13.5813.59506,864547  0% 1% 100% 0%
34Ruby JRuby #2 25.1019.651,166,576255  14% 12% 85% 18%
38Dart #3 22.6422.131,123,536551  2% 1% 100% 2%
42Python 3 #3 24.6224.65921,520295  0% 0% 1% 100%
43C++ g++ #5 25.1225.13188,568646  0% 0% 1% 100%
56Dart #2 33.2032.631,139,700555  1% 0% 100% 2%
63Erlang HiPE #4 45.0536.66689,3681167  77% 22% 9% 17%
101Erlang HiPE #3 61.0558.751,030,104624  4% 0% 1% 99%
Scala #6 Failed519
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.2Java  1.901.88512,576476
8.2Python 3 #5 4.764.77471,320306
11Clojure #3 7.726.50555,744812
missing benchmark programs
F# Mono No program
Rust 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