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.770.51250,784741  21% 18% 74% 43%
1.2C gcc 0.970.61445,9441867  25% 3% 98% 37%
1.3C++ g++ #4 1.020.65247,5082275  17% 64% 34% 48%
1.5Go 0.930.77250,5641243  10% 69% 11% 35%
1.5OCaml #3 0.7830,8401314  52% 29% 60% 78%
1.6Ada 2005 GNAT #2 0.980.83198,9083220  31% 80% 11% 4%
2.1C++ g++ #2 1.061.06247,1561082  0% 2% 4% 100%
2.2Go #2 1.101.10160,660546  2% 1% 99% 0%
2.2C gcc #4 1.141.14125,212704  0% 3% 100% 0%
2.3Fortran Intel 1.161.17246,4881013  0% 0% 100% 1%
2.3Go #3 1.181.18160,140543  2% 1% 1% 99%
2.3Rust #3 1.181.18254,7601059  3% 99% 0% 0%
2.4C++ g++ #3 1.241.24125,160810  1% 1% 3% 100%
2.7Haskell GHC #3 1.551.38126,340999  99% 4% 4% 4%
2.9Java  #3 2.971.47300,7121661  47% 37% 78% 43%
2.9Rust #2 1.481.49254,760739  0% 3% 100% 1%
3.0OCaml #4 1.531.54135,0962064  1% 0% 10% 99%
3.0Scala #8 2.021.54516,736761  3% 92% 5% 35%
3.1Java  #6 1.881.58517,816745  3% 39% 38% 46%
3.1OCaml 1.5962,9761064  4% 25% 65% 62%
4.0Pascal Free Pascal #2 2.022.02125,648751  1% 0% 100% 2%
4.6Scala #4 2.402.32411,280501  2% 4% 3% 98%
4.7Lisp SBCL 2.412.42396,200896  0% 0% 0% 100%
4.8Haskell GHC #2 2.842.44618,532919  6% 6% 100% 7%
4.9Java  #4 2.582.48482,760592  75% 2% 24% 4%
4.9Scala #7 4.952.50711,284949  34% 80% 52% 34%
5.3C# Mono 2.702.70178,7841099  0% 27% 73% 1%
5.3C++ g++ 2.702.71247,208571  3% 1% 100% 1%
5.6Clojure #5 4.382.86571,340727  44% 30% 64% 19%
5.7Perl #3 2.902.90374,704284  0% 0% 0% 100%
6.7Clojure 4.773.42402,8561044  32% 9% 83% 16%
8.5Racket #2 4.364.36171,3081026  0% 1% 100% 1%
8.6Clojure #4 5.874.38446,840997  98% 14% 13% 12%
8.8OCaml #2 4.504.51211,504394  0% 0% 0% 100%
11Ada 2005 GNAT 5.705.71125,744885  1% 96% 0% 4%
12Python 3 #4 5.925.941,008,592325  1% 1% 1% 100%
13PHP #2 6.406.41444,376262  0% 0% 0% 100%
13Fortran Intel #2 6.476.48174,276772  0% 0% 0% 100%
13PHP 6.596.61369,940297  0% 0% 0% 100%
13Hack 6.686.69459,952294  99% 1% 1% 0%
14Hack #2 6.916.92586,520261  1% 1% 1% 100%
16C# Mono #3 8.048.05294,644863  75% 5% 21% 1%
16Java  #7 2.358.07270,3761640  40% 7% 23% 75%
16Ruby #2 8.358.36130,032255  0% 100% 1% 0%
19Erlang 18.969.61922,5081302  63% 62% 39% 34%
20Erlang HiPE 19.939.98975,1241302  32% 33% 57% 80%
27Racket 13.6313.64546,072547  1% 0% 1% 100%
38C++ g++ #5 19.3719.38185,728646  0% 1% 100% 1%
38Dart #3 20.1119.611,791,052551  3% 44% 2% 56%
39Ruby JRuby #2 26.4619.661,243,664255  12% 49% 61% 15%
39Python 3 #3 19.8419.87966,060295  1% 0% 1% 100%
62Dart #2 32.1231.541,783,776555  2% 2% 1% 100%
67Erlang HiPE #4 42.5534.03776,8601167  79% 26% 12% 8%
72Erlang #4 46.5936.70662,4201167  94% 11% 12% 10%
107Erlang HiPE #3 57.2054.451,537,668624  1% 99% 9% 1%
133Erlang #3 69.7667.791,150,856624  52% 1% 0% 50%
158Rust 80.5680.59129,892433  1% 0% 100% 1%
Scala #6 Failed519
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.5Java  1.791.76516,244476
8.0Python 3 #5 4.094.10482,816306
8.6Clojure #3 5.524.37567,820812
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