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.610.62257,0562015  2% 5% 3% 100%
1.2C gcc #2 0.740.75250,408741  1% 1% 0% 100%
1.4C gcc 0.840.85496,8841867  0% 4% 3% 100%
1.6C++ g++ #4 0.980.99245,6922275  3% 1% 0% 99%
1.7Fortran Intel 1.031.04246,4641013  0% 0% 3% 100%
1.9Rust #3 1.171.17254,6521059  1% 0% 1% 100%
2.0Haskell GHC #3 1.221.22125,892999  0% 2% 2% 100%
2.1C++ g++ #2 1.291.29246,9401082  1% 2% 2% 99%
2.1C gcc #4 1.301.30125,088704  1% 1% 0% 100%
2.1C++ g++ #3 1.311.32124,956810  2% 2% 1% 100%
2.5Rust #2 1.531.54254,656739  0% 1% 2% 100%
2.5Ada 2005 GNAT #2 1.531.54200,5523220  1% 1% 1% 99%
2.7OCaml #4 1.661.66127,5842064  0% 1% 1% 100%
2.9Go #3 1.781.79163,228543  2% 1% 1% 100%
3.2Java  #6 1.961.97513,448745  1% 2% 0% 100%
3.2Go #2 1.971.98163,384546  1% 2% 0% 100%
3.4Pascal Free Pascal #2 2.062.06124,812751  1% 1% 0% 100%
3.4Go 2.102.10249,6281243  0% 0% 1% 100%
3.5Scala #8 2.122.14453,280761  1% 0% 1% 100%
3.5OCaml #3 2.1512,8801314  0% 0% 1% 100%
4.0Scala #4 2.462.47407,288501  0% 1% 1% 100%
4.2Haskell GHC #2 2.602.60580,368919  0% 3% 0% 100%
4.6Lisp SBCL 2.812.82257,248896  1% 1% 1% 100%
4.6Java  #3 2.842.85295,5761661  0% 2% 2% 100%
4.8C# Mono 2.962.97175,5201099  1% 0% 1% 100%
4.9Perl #3 3.023.03374,264284  1% 0% 0% 100%
5.1Java  #4 3.113.12476,804592  1% 1% 0% 100%
5.1OCaml 3.1225,7041064  0% 0% 0% 100%
6.0C++ g++ 3.713.72246,924571  1% 1% 1% 100%
6.6Ada 2005 GNAT 4.024.03125,448885  2% 0% 1% 100%
7.3OCaml #2 4.504.51171,972394  0% 0% 0% 100%
7.3Racket #2 4.504.51171,8001026  1% 1% 1% 100%
7.8Scala #7 4.804.82797,196949  0% 1% 1% 100%
11Clojure 6.486.49406,9521044  0% 1% 1% 100%
11Clojure #5 6.546.55561,320727  0% 1% 1% 100%
11Python 3 #4 6.546.56781,140325  1% 0% 1% 100%
12JavaScript V8 #4 7.377.38313,048787  1% 1% 0% 100%
13PHP #2 7.867.88443,500262  0% 0% 0% 100%
13PHP 7.967.98369,064297  0% 1% 1% 100%
13Clojure #4 7.977.98446,216997  1% 0% 1% 100%
13Java  #7 2.388.24265,3241640  37% 48% 1% 95%
14Fortran Intel #2 8.518.53176,104772  0% 1% 1% 100%
15C# Mono #3 9.149.15212,308863  1% 1% 1% 100%
17Ruby #2 10.6310.64127,856255  0% 1% 0% 100%
20JavaScript V8 #3 12.0112.03288,864498  0% 1% 1% 100%
22Racket 13.5513.57506,856547  0% 1% 1% 100%
32Dart #3 19.6319.651,100,816551  1% 3% 3% 100%
35Erlang HiPE 21.2421.26563,3481302  0% 0% 0% 100%
35JavaScript V8 #2 21.4021.42358,508456  0% 1% 1% 100%
37Lua 22.4922.51724,576555  0% 0% 0% 100%
40Python 3 #3 24.5924.62911,484295  0% 1% 0% 100%
41C++ g++ #5 25.1825.19125,128646  0% 0% 1% 100%
41Ruby JRuby #2 25.2725.301,189,288255  0% 1% 0% 100%
43JavaScript V8 26.1626.19295,580390  0% 1% 1% 100%
45Smalltalk VisualWorks 27.3927.42373,712754  0% 1% 1% 100%
48Dart #2 29.3629.391,103,588555  0% 1% 1% 100%
56Erlang HiPE #4 34.5734.60625,9481167  0% 1% 1% 100%
83Erlang HiPE #3 50.9350.99861,592624  0% 0% 0% 100%
126C CINT #2 77.3377.34127,432727  0% 0% 0% 100%
133Rust 81.5681.59129,808433  1% 0% 0% 100%
Lua #3 Failed593
Scala #6 Failed519
Scala #5 Failed329
"wrong" (different) algorithm / less comparable programs
3.1Java  1.871.88512,512476
7.7Python 3 #5 4.724.73480,296306
13Clojure #3 7.707.71556,088812
72JavaScript V8 #5 44.3844.43554,664407
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