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

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

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
1.0Ruby JRuby #2 22.9416.191,305,544255  43% 43% 44% 17%
1.0Ruby #2 10.4510.46129,336255  0% 0% 1% 100%
1.0PHP #2 7.107.11443,484262  0% 0% 1% 100%
1.1Perl #3 2.932.94375,804284  1% 1% 0% 100%
1.2PHP 7.037.04369,104297  1% 1% 0% 100%
1.3Python 3 #4 6.376.38781,124325  0% 1% 100% 0%
1.5OCaml #2 4.104.11171,688394  1% 1% 0% 100%
2.0Scala #4 2.662.55422,244501  31% 2% 72% 4%
2.1Go #3 1.721.72164,092543  1% 4% 100% 1%
2.1Go #2 2.012.01164,092546  0% 1% 1% 100%
2.1Racket 13.1713.17531,720547  1% 1% 0% 100%
2.2Dart #3 21.6220.92987,480551  13% 88% 1% 2%
2.2Dart #2 22.5421.84988,076555  53% 27% 16% 9%
2.2C++ g++ 3.883.89247,640571  100% 1% 0% 0%
2.3Java  #4 2.732.59486,716592  38% 63% 4% 4%
2.4Erlang HiPE #3 58.6556.93867,712624  4% 93% 0% 7%
2.5C++ g++ #5 30.3230.33178,784646  100% 1% 0% 0%
2.8C gcc #4 1.431.43125,884704  100% 0% 2% 0%
2.9Clojure #5 6.584.54517,384727  29% 12% 58% 49%
2.9C gcc #2 0.860.60251,368741  95% 84% 44% 15%
2.9Java  #6 1.951.67524,704745  2% 45% 4% 70%
2.9Pascal Free Pascal #2 2.062.06124,428751  0% 1% 0% 100%
3.0Scala #8 1.981.52520,732761  46% 2% 36% 49%
3.0Fortran Intel #2 7.867.86159,940772  1% 1% 0% 100%
3.1Python 3 #6 5.453.72259,780800  30% 1% 72% 47%
3.2C++ g++ #3 1.411.41126,500810  99% 1% 0% 0%
3.4C# Mono #3 5.735.53215,424863  2% 1% 100% 4%
3.4Go #4 1.921.24452,176874  19% 20% 46% 72%
3.5Ada 2005 GNAT 3.843.85126,464885  1% 100% 0% 1%
3.5Lisp SBCL 3.223.23209,500896  1% 1% 100% 0%
3.6Haskell GHC #2 2.992.72625,676919  7% 4% 100% 5%
3.9Haskell GHC #3 1.561.46134,216999  2% 100% 3% 2%
3.9Clojure #4 7.405.99472,0521005  18% 83% 15% 9%
4.0Fortran Intel 0.930.94247,4721013  1% 0% 3% 99%
4.0Racket #2 4.494.49172,2761026  1% 100% 0% 1%
4.2OCaml 2.5730,8921064  11% 16% 75% 70%
4.2C++ g++ #2 1.171.17248,1201082  1% 100% 1% 3%
4.3C# Mono 1.681.68195,5961099  2% 1% 1% 98%
4.5Clojure 6.024.86441,4801135  23% 7% 11% 86%
4.6Erlang HiPE #4 44.4936.04669,0561167  20% 11% 27% 67%
4.9Go 2.161.89249,5601243  2% 3% 99% 13%
5.1Erlang HiPE 21.0811.00844,9201302  43% 50% 51% 50%
5.2OCaml #3 1.2415,1601314  64% 31% 60% 50%
6.4Java  #7 4.109.44275,9041640  13% 19% 59% 26%
6.5Java  #3 2.911.44308,0601661  47% 31% 85% 43%
7.3C gcc 1.140.77497,4641867  24% 8% 94% 30%
7.8Rust 1.291.08260,0641985  14% 7% 19% 81%
8.1OCaml #4 1.781.78264,4002064  2% 1% 1% 100%
8.9C++ g++ #4 1.170.78247,3402275  23% 87% 11% 47%
13Ada 2005 GNAT #2 1.201.01202,6803220  60% 42% 2% 24%
Scala #6 Failed519
Scala #5 Failed329
Scala #7 Failed949
"wrong" (different) algorithm / less comparable programs
1.2Python 3 #5 4.584.59489,528306
1.9Java  1.741.70522,408476
3.2Clojure #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