reverse-complement benchmark ≈240MB N=25,000,000

Each chart bar shows how many times more Memory, one ↓ reverse-complement program used, compared to the program that used least Memory.

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.

    sortsort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0OCaml #3 1.2415,1601314  64% 31% 60% 50%
2.0OCaml 2.5730,8921064  11% 16% 75% 70%
8.2Pascal Free Pascal #2 2.062.06124,428751  0% 1% 0% 100%
8.2C++ g++ #3 1.321.32124,956810  2% 3% 2% 100%
8.3C gcc #4 1.291.29125,132704  0% 1% 3% 100%
8.3Ada 2005 GNAT 4.034.03125,464885  1% 0% 1% 100%
8.5Ruby #2 10.4510.46129,336255  0% 0% 1% 100%
8.9Haskell GHC #3 1.561.46134,216999  2% 100% 3% 2%
11Fortran Intel #2 7.867.86159,940772  1% 1% 0% 100%
11Go #3 1.721.72164,092543  1% 4% 100% 1%
11Go #2 2.012.01164,092546  0% 1% 1% 100%
11OCaml #2 4.104.11171,688394  1% 1% 0% 100%
11Racket #2 4.484.48172,5481026  1% 1% 100% 1%
12C# Mono 2.962.97175,5201099  0% 99% 1% 2%
12C++ g++ #5 25.1225.13188,568646  0% 0% 1% 100%
13Ada 2005 GNAT #2 1.551.15200,6163220  1% 41% 1% 94%
14Lisp SBCL 3.203.21216,240896  1% 1% 100% 0%
15C# Mono #3 9.189.19222,152863  100% 1% 1% 1%
16C++ g++ #2 1.291.29246,9961082  0% 3% 1% 100%
16C++ g++ #4 1.150.75247,0082275  11% 87% 30% 29%
16C++ g++ 3.683.69247,044571  1% 0% 2% 100%
16Fortran Intel 0.930.94247,4721013  1% 0% 3% 99%
16Go 2.161.89249,5601243  2% 3% 99% 13%
17C gcc #2 0.840.58250,384741  14% 76% 21% 41%
17Rust 0.740.53257,0321896  2% 28% 63% 51%
17Python 3 #6 5.063.49258,604800  46% 1% 27% 74%
17OCaml #4 1.781.78264,4002064  2% 1% 1% 100%
18Java  #7 2.908.78270,6881640  36% 27% 35% 18%
20Java  #3 2.671.36306,1561661  81% 33% 38% 47%
24PHP 7.037.04369,104297  1% 1% 0% 100%
25Perl #3 2.932.94375,804284  1% 1% 0% 100%
27Scala #4 2.292.19415,228501  90% 3% 12% 3%
28Clojure 6.154.79418,9401044  15% 49% 55% 13%
29PHP #2 7.107.11443,484262  0% 0% 1% 100%
30Go #4 1.921.24452,176874  19% 20% 46% 72%
30Clojure #4 8.006.31460,640997  12% 11% 99% 7%
32Java  #4 2.872.78481,900592  2% 100% 2% 1%
33C gcc 1.050.70496,8361867  13% 87% 32% 23%
33Racket 13.5813.59506,864547  0% 1% 100% 0%
34Scala #8 1.871.41518,472761  1% 39% 3% 91%
34Java  #6 1.681.40519,728745  6% 37% 68% 11%
37Clojure #5 6.784.58562,476727  45% 45% 15% 46%
41Haskell GHC #2 2.992.72625,676919  7% 4% 100% 5%
44Erlang HiPE #4 44.4936.04669,0561167  20% 11% 27% 67%
52Python 3 #4 6.536.55781,144325  0% 1% 0% 100%
56Erlang HiPE 21.0811.00844,9201302  43% 50% 51% 50%
57Erlang HiPE #3 58.6556.93867,712624  4% 93% 0% 7%
61Python 3 #3 24.6224.65921,520295  0% 0% 1% 100%
65Dart #2 23.1722.45982,976555  1% 3% 16% 85%
65Dart #3 18.5617.90984,920551  39% 44% 20% 3%
86Ruby JRuby #2 24.2216.691,309,952255  47% 51% 32% 16%
Scala #6 Failed519
Scala #5 Failed329
Scala #7 Failed949
"wrong" (different) algorithm / less comparable programs
31Python 3 #5 4.764.77471,320306
34Java  1.561.54518,064476
37Clojure #3 7.586.40562,384812
missing benchmark programs
F# Mono No program

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

You can write your own program for this task and contribute to the benchmarks game by following these general instructions.

More specifically:

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