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.03258,1881985  82% 10% 18% 14%
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%
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.5C# Mono 2.702.70178,7841099  0% 27% 73% 1%
5.5Clojure #5 4.062.73569,780727  15% 35% 95% 7%
5.6Perl #3 2.742.74375,760284  1% 0% 0% 100%
5.6C++ g++ 2.752.76248,576571  1% 1% 0% 100%
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.5Clojure 4.493.20427,3561044  13% 92% 24% 14%
8.5Clojure #4 5.554.18475,752997  58% 14% 52% 11%
8.7OCaml #2 4.274.28214,136394  1% 0% 1% 100%
8.8Racket #2 4.354.36182,3601026  1% 1% 100% 1%
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%
13Hack 6.456.46449,372294  1% 99% 1% 1%
14Hack #2 6.886.89575,896261  1% 100% 1% 1%
14Java  #7 3.067.14283,6921640  17% 7% 38% 85%
16C# Mono #3 8.048.05294,644863  75% 5% 21% 1%
17Ruby #2 8.388.39131,808255  0% 1% 0% 100%
21Erlang 20.4410.301,002,1881302  40% 70% 38% 52%
21Erlang HiPE 20.7110.53947,6881302  42% 75% 38% 43%
28Racket 13.8313.84566,096547  1% 1% 0% 100%
37Ruby JRuby #2 24.8418.241,284,372255  22% 14% 14% 88%
39Dart #3 20.0519.461,776,844551  1% 3% 18% 83%
46C++ g++ #5 22.6322.64141,236646  100% 0% 1% 1%
49Dart #2 25.0424.341,761,536555  2% 89% 11% 3%
70Erlang HiPE #4 43.4734.81641,3401167  76% 29% 10% 11%
73Erlang #4 46.0835.90631,9281167  17% 54% 20% 39%
111Erlang HiPE #3 57.1454.901,233,548624  38% 31% 21% 16%
135Erlang #3 68.5166.571,087,836624  32% 51% 19% 3%
Scala #6 Failed519
Scala #7 Failed949
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.2Java  1.601.56527,324476
7.8Python 3 #5 3.843.85496,920306
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