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%
2.0Rust 1.381.17258,0521985  84% 14% 17% 12%
2.0C++ g++ #2 1.171.17248,1201082  1% 100% 1% 3%
2.1OCaml #3 1.2415,1601314  64% 31% 60% 50%
2.1Go 1.541.28265,8561243  12% 1% 100% 10%
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.9C# Mono 1.701.70195,3041099  1% 4% 1% 99%
3.0OCaml #4 1.781.78264,4002064  2% 1% 1% 100%
3.1Go #3 1.901.87171,468543  2% 100% 3% 2%
3.4Go #2 2.052.02171,588546  89% 13% 2% 2%
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.6Clojure #5 6.584.54517,384727  29% 12% 58% 49%
8.1Clojure 6.024.86441,4801135  23% 7% 11% 86%
9.6C# Mono #3 5.935.73214,776863  5% 0% 100% 1%
10Clojure #4 7.405.99472,0521005  18% 83% 15% 9%
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%
19Erlang HiPE 22.1211.46854,5921302  49% 45% 69% 37%
22Racket 13.1713.17531,720547  1% 1% 0% 100%
27Ruby JRuby #2 23.1016.10599,780255  58% 20% 20% 48%
35Dart #3 21.6220.92987,480551  13% 88% 1% 2%
37Dart #2 22.5421.84988,076555  53% 27% 16% 9%
51C++ g++ #5 30.3230.33178,784646  100% 1% 0% 0%
65Erlang HiPE #4 47.8738.96669,9161167  21% 12% 8% 83%
103Erlang HiPE #3 62.8961.10897,624624  10% 24% 48% 22%
Go #4 Bad Output874
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
9.7Clojure #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