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 0.580.59257,0641896  0% 2% 0% 100%
1.1C gcc #2 0.670.67250,856741  3% 0% 2% 100%
1.3C gcc 0.740.74403,4681867  1% 0% 4% 100%
1.4Go 0.790.80250,7561243  1% 0% 0% 100%
1.5C++ g++ #4 0.870.87245,7242275  3% 1% 0% 100%
1.7Ada 2005 GNAT #2 0.970.98198,8883220  0% 0% 2% 99%
1.7Fortran Intel 1.011.01183,8201013  0% 1% 2% 100%
1.8C++ g++ #2 1.051.06247,0561082  0% 1% 4% 100%
1.9Go #2 1.101.11160,940546  2% 1% 1% 100%
1.9C gcc #4 1.141.14125,212704  0% 0% 2% 100%
1.9Go #3 1.141.14160,732543  0% 4% 2% 100%
2.0Haskell GHC #3 1.191.19127,172999  2% 2% 0% 99%
2.1C++ g++ #3 1.231.23125,160810  2% 0% 1% 100%
2.2OCaml #3 0.001.2832,5521314  2% 2% 1% 100%
2.7OCaml #4 1.481.60131,9362064  0% 1% 3% 100%
2.8Java  #6 1.631.63524,612745  0% 2% 1% 99%
2.9Scala #8 1.711.71497,432761  1% 3% 1% 99%
3.5Haskell GHC #2 2.022.02620,012919  1% 1% 1% 100%
3.5Pascal Free Pascal #2 2.022.02123,976751  3% 0% 2% 100%
3.6OCaml 0.002.1165,5561064  0% 2% 0% 100%
3.8Scala #4 2.192.20416,316501  1% 0% 1% 100%
3.9Lisp SBCL 2.262.26291,560896  1% 0% 1% 100%
4.0Java  #4 2.332.34485,936592  0% 0% 1% 100%
4.1Java  #3 2.422.42307,5841661  0% 1% 2% 100%
4.6Perl #3 2.662.67376,248284  0% 0% 1% 100%
4.6C# Mono 2.702.70178,7841099  0% 4% 1% 100%
4.6C++ g++ 2.702.71247,168571  0% 1% 0% 100%
6.8Clojure #5 3.963.97573,124727  2% 1% 1% 100%
7.1Python 3 #6 4.154.16262,816800  0% 0% 1% 100%
7.2Clojure 4.174.18424,8961044  0% 2% 1% 100%
7.3OCaml #2 4.254.26214,244394  0% 0% 1% 100%
7.5Racket #2 4.364.36171,3161026  0% 0% 1% 100%
9.1Clojure #4 5.325.33467,704997  0% 1% 1% 100%
9.8Ada 2005 GNAT 5.725.72125,448885  1% 0% 1% 100%
10PHP #2 5.825.83444,352262  1% 1% 1% 100%
10PHP 5.875.88369,928297  1% 1% 1% 100%
10Python 3 #4 5.986.001,008,592325  0% 1% 1% 100%
11Fortran Intel #2 6.396.39151,808772  1% 0% 0% 100%
11Hack 6.416.42447,396294  0% 1% 1% 100%
12Hack #2 6.816.82575,896261  0% 1% 0% 100%
13JavaScript V8 #4 7.477.48422,736787  0% 1% 1% 100%
14C# Mono #3 8.058.06294,672863  0% 0% 1% 100%
14Ruby #2 8.378.38131,592255  1% 0% 0% 100%
15Java  #7 2.018.64275,7761640  45% 1% 1% 97%
23JavaScript V8 #3 13.1913.20417,084498  0% 1% 1% 100%
23Racket 13.6613.68546,088547  1% 0% 1% 100%
33Erlang HiPE 19.1519.17650,7601302  1% 0% 1% 100%
33C++ g++ #5 19.3719.38142,176646  1% 0% 1% 100%
34Python 3 #3 19.9419.97983,752295  1% 1% 1% 100%
34Dart #3 19.9519.981,776,100551  0% 1% 1% 100%
41Ruby JRuby #2 24.2524.271,282,636255  0% 1% 1% 100%
43Dart #2 24.8824.921,761,456555  0% 1% 1% 100%
44JavaScript V8 #2 25.8525.89491,908456  0% 0% 1% 100%
52Smalltalk VisualWorks 30.5930.61331,644754  0% 1% 1% 100%
53JavaScript V8 30.8030.84405,220390  0% 0% 1% 100%
59Erlang HiPE #4 34.5834.60604,4521167  1% 0% 0% 100%
83Erlang HiPE #3 48.5748.651,243,932624  0% 1% 1% 100%
159JavaScript V8 #6 93.0893.11485,732359  1% 0% 0% 100%
Go #4 Bad Output874
Lua #3 Failed593
Lua Failed555
Scala #6 Failed519
Scala #7 Failed949
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
2.7Java  1.551.55520,504476
7.0Python 3 #5 4.074.08488,100306
8.6Clojure #3 5.055.06572,172812
83JavaScript V8 #5 48.5148.56847,892407
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