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.

     sortsortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 OCaml 2.5730,8921064  11% 16% 75% 70%
 OCaml #3 1.2415,1601314  64% 31% 60% 50%
 C gcc #2 0.860.60251,368741  95% 84% 44% 15%
 Fortran Intel 0.930.94247,4721013  1% 0% 3% 99%
 C gcc 1.140.77497,4641867  24% 8% 94% 30%
 C++ g++ #2 1.171.17248,1201082  1% 100% 1% 3%
 C++ g++ #4 1.170.78247,3402275  23% 87% 11% 47%
 Ada 2005 GNAT #2 1.201.01202,6803220  60% 42% 2% 24%
 Rust 1.291.08260,0641985  14% 7% 19% 81%
 C++ g++ #3 1.411.41126,500810  99% 1% 0% 0%
 C gcc #4 1.431.43125,884704  100% 0% 2% 0%
 Haskell GHC #3 1.561.46134,216999  2% 100% 3% 2%
 C# Mono 1.681.68195,5961099  2% 1% 1% 98%
 Go #3 1.721.72164,092543  1% 4% 100% 1%
 OCaml #4 1.781.78264,4002064  2% 1% 1% 100%
 Go #4 1.921.24452,176874  19% 20% 46% 72%
 Java  #6 1.951.67524,704745  2% 45% 4% 70%
 Scala #8 1.981.52520,732761  46% 2% 36% 49%
 Go #2 2.012.01164,092546  0% 1% 1% 100%
 Pascal Free Pascal #2 2.062.06124,428751  0% 1% 0% 100%
 Go 2.161.89249,5601243  2% 3% 99% 13%
 Scala #4 2.662.55422,244501  31% 2% 72% 4%
 Java  #4 2.732.59486,716592  38% 63% 4% 4%
 Java  #3 2.911.44308,0601661  47% 31% 85% 43%
 Perl #3 2.932.94375,804284  1% 1% 0% 100%
 Haskell GHC #2 2.992.72625,676919  7% 4% 100% 5%
 Lisp SBCL 3.223.23209,500896  1% 1% 100% 0%
 Ada 2005 GNAT 3.843.85126,464885  1% 100% 0% 1%
 C++ g++ 3.883.89247,640571  100% 1% 0% 0%
 OCaml #2 4.104.11171,688394  1% 1% 0% 100%
 Java  #7 4.109.44275,9041640  13% 19% 59% 26%
 Racket #2 4.494.49172,2761026  1% 100% 0% 1%
 Python 3 #6 5.453.72259,780800  30% 1% 72% 47%
 C# Mono #3 5.735.53215,424863  2% 1% 100% 4%
 Clojure 6.024.86441,4801135  23% 7% 11% 86%
 Python 3 #4 6.376.38781,124325  0% 1% 100% 0%
 Clojure #5 6.584.54517,384727  29% 12% 58% 49%
 PHP 7.037.04369,104297  1% 1% 0% 100%
 PHP #2 7.107.11443,484262  0% 0% 1% 100%
 Clojure #4 7.405.99472,0521005  18% 83% 15% 9%
 Fortran Intel #2 7.867.86159,940772  1% 1% 0% 100%
 Ruby #2 10.4510.46129,336255  0% 0% 1% 100%
 Racket 13.1713.17531,720547  1% 1% 0% 100%
 Dart #3 21.6220.92987,480551  13% 88% 1% 2%
 Erlang HiPE 22.1211.46854,5921302  49% 45% 69% 37%
 Dart #2 22.5421.84988,076555  53% 27% 16% 9%
 Ruby JRuby #2 22.9416.191,305,544255  43% 43% 44% 17%
 C++ g++ #5 30.3230.33178,784646  100% 1% 0% 0%
 Erlang HiPE #4 47.8738.96669,9161167  21% 12% 8% 83%
 Erlang HiPE #3 62.8961.10897,624624  10% 24% 48% 22%
Scala #6 Failed519
Scala #5 Failed329
Scala #7 Failed949
"wrong" (different) algorithm / less comparable programs
 Java  1.741.70522,408476
 Python 3 #5 4.584.59489,528306
 Clojure #3 7.085.77563,300812
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