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.0Rust #4 0.740.49257,1602015  12% 82% 41% 18%
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.920.76250,6801243  88% 9% 26% 3%
1.6OCaml #3 0.7830,8401314  52% 29% 60% 78%
1.7Ada 2005 GNAT #2 0.980.83198,9083220  31% 80% 11% 4%
2.2C++ g++ #2 1.061.06247,1561082  0% 2% 4% 100%
2.3Go #2 1.111.11160,948546  0% 0% 100% 3%
2.3Go #3 1.141.14160,720543  2% 1% 100% 1%
2.3C gcc #4 1.141.14125,212704  0% 3% 100% 0%
2.4Fortran Intel 1.161.17246,4881013  0% 0% 100% 1%
2.4Rust #3 1.181.18254,7601059  3% 99% 0% 0%
2.5C++ g++ #3 1.241.24125,160810  1% 1% 3% 100%
2.5Java  #3 2.731.25307,7401661  37% 90% 44% 50%
2.7Scala #8 1.791.34503,168761  6% 3% 90% 40%
2.8Java  #6 1.651.36523,400745  80% 36% 4% 5%
2.8Haskell GHC #3 1.551.38126,340999  99% 4% 4% 4%
3.0Rust #2 1.481.49254,760739  0% 3% 100% 1%
3.1OCaml #4 1.531.54135,0962064  1% 0% 10% 99%
3.2OCaml 1.5962,9761064  4% 25% 65% 62%
4.1Pascal Free Pascal #2 2.022.02125,648751  1% 0% 100% 2%
4.3Scala #4 2.202.14415,572501  72% 24% 3% 6%
4.6Lisp SBCL 2.262.26291,560896  1% 0% 100% 0%
5.0Haskell GHC #2 2.842.44618,532919  6% 6% 100% 7%
5.1Java  #4 2.592.49488,368592  95% 2% 6% 2%
5.5C# Mono 2.702.70178,7841099  0% 27% 73% 1%
5.5C++ g++ 2.702.71247,208571  3% 1% 100% 1%
5.5Clojure #5 4.062.73569,780727  15% 35% 95% 7%
5.9Perl #3 2.902.90374,704284  0% 0% 0% 100%
6.5Clojure 4.493.20427,3561044  13% 92% 24% 14%
8.5Clojure #4 5.554.18475,752997  58% 14% 52% 11%
8.9Racket #2 4.364.36171,3081026  0% 1% 100% 1%
9.2OCaml #2 4.504.51211,504394  0% 0% 0% 100%
12Ada 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%
13Hack 6.456.46449,372294  1% 99% 1% 1%
13Fortran Intel #2 6.476.48174,276772  0% 0% 0% 100%
13PHP 6.596.61369,940297  0% 0% 0% 100%
14Hack #2 6.886.89575,896261  1% 100% 1% 1%
16Java  #7 2.187.74274,6001640  69% 22% 4% 71%
16C# Mono #3 8.048.05294,644863  75% 5% 21% 1%
17Ruby #2 8.218.22132,256255  1% 0% 0% 100%
21Erlang 20.4410.301,002,1881302  40% 70% 38% 52%
21Erlang HiPE 20.7110.53947,6881302  42% 75% 38% 43%
28Racket 13.6313.64546,072547  1% 0% 1% 100%
37Ruby JRuby #2 24.8418.241,284,372255  22% 14% 14% 88%
39Dart #3 19.5719.211,757,524551  2% 0% 100% 2%
39C++ g++ #5 19.3719.38185,728646  0% 1% 100% 1%
40Python 3 #3 19.8419.87966,060295  1% 0% 1% 100%
56Dart #2 28.0227.611,754,748555  1% 1% 2% 100%
71Erlang HiPE #4 43.4734.81641,3401167  76% 29% 10% 11%
73Erlang #4 46.0835.90631,9281167  17% 54% 20% 39%
112Erlang HiPE #3 57.1454.901,233,548624  38% 31% 21% 16%
135Erlang #3 68.5166.571,087,836624  32% 51% 19% 3%
164Rust 80.5680.59129,892433  1% 0% 100% 1%
Scala #6 Failed519
Scala #7 Failed949
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.1Java  1.571.54523,892476
8.3Python 3 #5 4.094.10482,816306
8.4Clojure #3 5.344.15576,444812
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