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.750.49251,716741  33% 20% 31% 72%
1.2C++ g++ #4 0.950.58214,0122275  41% 26% 14% 86%
1.2C gcc 0.930.58373,5161867  96% 4% 24% 38%
1.5OCaml #3 0.000.7331,4361314  47% 47% 52% 70%
1.5Go 0.920.76250,6801243  88% 9% 26% 3%
1.5Go #4 1.330.77453,000874  59% 51% 26% 43%
1.6Ada 2005 GNAT #2 0.910.78203,0363220  79% 3% 4% 37%
2.0C++ g++ #2 0.960.97247,9561082  100% 1% 0% 2%
2.0Fortran Intel 1.011.01248,6361013  2% 2% 99% 3%
2.1Rust 1.241.03260,1121985  13% 82% 10% 19%
2.2Go #2 1.111.11160,948546  0% 0% 100% 3%
2.3C gcc #4 1.121.13126,044704  0% 6% 4% 100%
2.3Go #3 1.141.14160,720543  2% 1% 100% 1%
2.3C++ g++ #3 1.151.16126,732810  1% 100% 2% 1%
2.6Java  #3 2.681.27315,2961661  41% 48% 34% 92%
2.7Scala #8 1.801.36477,268761  39% 4% 90% 4%
2.8Haskell GHC #3 1.521.36129,412999  3% 5% 4% 100%
2.8Java  #6 1.701.40526,320745  4% 37% 4% 82%
3.0OCaml #4 1.491.49137,3762064  0% 1% 9% 100%
3.1OCaml 0.001.5265,2641064  4% 8% 79% 63%
3.1C# Mono 1.551.55199,3801099  99% 1% 2% 1%
4.1Pascal Free Pascal #2 2.022.02125,648751  1% 0% 100% 2%
4.4Scala #4 2.282.18376,408501  4% 100% 1% 3%
4.6Lisp SBCL 2.272.28294,624896  1% 100% 1% 0%
4.7Java  #4 2.402.30371,252592  3% 99% 4% 3%
4.7Haskell GHC #2 2.732.34628,112919  8% 7% 100% 6%
5.6Perl #3 2.742.74375,760284  1% 0% 0% 100%
5.6C++ g++ 2.752.76248,576571  1% 1% 0% 100%
5.6Clojure #5 4.362.77585,660727  10% 17% 43% 91%
5.8Ada 2005 GNAT 2.852.85126,984885  100% 0% 2% 1%
6.0Python 3 #6 4.402.95262,292800  21% 81% 2% 48%
6.4Clojure 4.203.16410,4841135  83% 14% 11% 26%
8.6Clojure #4 5.744.25364,9921005  16% 77% 33% 11%
8.7OCaml #2 4.274.28214,136394  1% 0% 1% 100%
8.8Racket #2 4.354.36182,3601026  1% 1% 100% 1%
9.9C# Mono #3 5.094.87261,800863  5% 2% 0% 100%
11Python 3 #4 5.655.661,010,488325  1% 100% 1% 1%
12PHP #2 5.845.84444,344262  1% 0% 1% 100%
12PHP 5.845.85369,924297  1% 1% 1% 100%
13Fortran Intel #2 6.436.43155,376772  1% 89% 1% 11%
14Java  #7 3.067.14283,6921640  17% 7% 38% 85%
15Hack #2 7.207.22491,796261  53% 4% 0% 45%
16Hack 8.068.07490,152294  4% 97% 1% 1%
17Ruby #2 8.388.39131,808255  0% 1% 0% 100%
21Erlang 20.1810.341,029,9521302  44% 46% 51% 56%
22Erlang HiPE 21.1610.83859,3001302  33% 92% 30% 42%
28Racket 13.8313.84566,096547  1% 1% 0% 100%
37Ruby JRuby #2 24.8418.241,284,372255  22% 14% 14% 88%
45Dart #3 22.8822.301,770,192551  5% 55% 34% 11%
46C++ g++ #5 22.6322.64141,236646  100% 0% 1% 1%
48Dart #2 24.1823.491,768,620555  88% 3% 15% 1%
72Erlang #4 46.0835.63675,4161167  12% 78% 29% 11%
77Erlang HiPE #4 47.2438.09637,3401167  54% 9% 53% 10%
116Erlang HiPE #3 60.1057.461,336,884624  18% 17% 50% 24%
134Erlang #3 68.0966.011,196,576624  27% 1% 73% 3%
Scala #6 Failed519
Scala #7 Failed949
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.2Java  1.601.56527,324476
7.3Clojure #3 4.623.62586,000812
7.8Python 3 #5 3.843.85496,920306
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