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.860.60251,368741  95% 84% 44% 15%
1.3C gcc 1.140.77497,4641867  24% 8% 94% 30%
1.3C++ g++ #4 1.170.78247,3402275  23% 87% 11% 47%
1.6Fortran Intel 0.930.94247,4721013  1% 0% 3% 99%
1.7Ada 2005 GNAT #2 1.201.01202,6803220  60% 42% 2% 24%
1.8Rust 1.321.06260,0521985  20% 16% 12% 80%
2.0C++ g++ #2 1.171.17248,1201082  1% 100% 1% 3%
2.1Go #4 1.921.24452,176874  19% 20% 46% 72%
2.1OCaml #3 1.2415,1601314  64% 31% 60% 50%
2.4C++ g++ #3 1.411.41126,500810  99% 1% 0% 0%
2.4C gcc #4 1.431.43125,884704  100% 0% 2% 0%
2.4Java  #3 2.911.44308,0601661  47% 31% 85% 43%
2.4Haskell GHC #3 1.561.46134,216999  2% 100% 3% 2%
2.6Scala #8 1.981.52520,732761  46% 2% 36% 49%
2.8Java  #6 1.951.67524,704745  2% 45% 4% 70%
2.8C# Mono 1.681.68195,5961099  2% 1% 1% 98%
2.9Go #3 1.721.72164,092543  1% 4% 100% 1%
3.0OCaml #4 1.781.78264,4002064  2% 1% 1% 100%
3.2Go 2.161.89249,5601243  2% 3% 99% 13%
3.4Go #2 2.012.01164,092546  0% 1% 1% 100%
3.5Pascal Free Pascal #2 2.062.06124,428751  0% 1% 0% 100%
4.3Scala #4 2.662.55422,244501  31% 2% 72% 4%
4.3OCaml 2.5730,8921064  11% 16% 75% 70%
4.3Java  #4 2.732.59486,716592  38% 63% 4% 4%
4.6Haskell GHC #2 2.992.72625,676919  7% 4% 100% 5%
4.9Perl #3 2.932.94375,804284  1% 1% 0% 100%
5.4Lisp SBCL 3.223.23209,500896  1% 1% 100% 0%
6.2Python 3 #6 5.453.72259,780800  30% 1% 72% 47%
6.5Ada 2005 GNAT 3.843.85126,464885  1% 100% 0% 1%
6.5C++ g++ 3.883.89247,640571  100% 1% 0% 0%
6.9OCaml #2 4.104.11171,688394  1% 1% 0% 100%
7.5Racket #2 4.494.49172,2761026  1% 100% 0% 1%
7.7Clojure #5 6.784.58562,476727  45% 45% 15% 46%
8.0Clojure 6.154.79418,9401044  15% 49% 55% 13%
9.3C# Mono #3 5.735.53215,424863  2% 1% 100% 4%
11Clojure #4 8.006.31460,640997  12% 11% 99% 7%
11Python 3 #4 6.376.38781,124325  0% 1% 100% 0%
12PHP 7.037.04369,104297  1% 1% 0% 100%
12PHP #2 7.107.11443,484262  0% 0% 1% 100%
13Fortran Intel #2 7.867.86159,940772  1% 1% 0% 100%
16Java  #7 4.109.44275,9041640  13% 19% 59% 26%
18Ruby #2 10.4510.46129,336255  0% 0% 1% 100%
18Erlang HiPE 21.0811.00844,9201302  43% 50% 51% 50%
22Racket 13.1713.17531,720547  1% 1% 0% 100%
27Ruby JRuby #2 22.9416.191,305,544255  43% 43% 44% 17%
30Dart #3 18.5617.90984,920551  39% 44% 20% 3%
38Dart #2 23.1722.45982,976555  1% 3% 16% 85%
51C++ g++ #5 30.3230.33178,784646  100% 1% 0% 0%
60Erlang HiPE #4 44.4936.04669,0561167  20% 11% 27% 67%
96Erlang HiPE #3 58.6556.93867,712624  4% 93% 0% 7%
Scala #6 Failed519
Scala #5 Failed329
Scala #7 Failed949
"wrong" (different) algorithm / less comparable programs
2.8Java  1.741.70522,408476
7.7Python 3 #5 4.584.59489,528306
11Clojure #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