k-nucleotide benchmark ≈240MB N=25,000,000

Each chart bar shows how many times slower, one ↓ k-nucleotide 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++ g++ #3 18.1018.13152,5521252  0% 1% 1% 100%
1.2Clojure #5 21.4221.44400,0042723  0% 1% 0% 100%
1.5Rust 27.2127.23152,5082113  0% 1% 1% 100%
1.7Go #3 30.7530.77254,5801399  0% 0% 1% 100%
1.8C gcc #7 32.1532.18180,3082280  0% 1% 1% 100%
1.8Ada 2005 GNAT #2 32.1832.23276,1924865  1% 1% 1% 100%
1.8Lisp SBCL #4 33.0933.13152,1842272  0% 1% 1% 100%
1.8Lisp SBCL #5 33.1133.14152,1842301  0% 1% 0% 100%
1.9Java  #7 34.7834.841,119,0841844  0% 1% 1% 100%
2.0C gcc #9 36.5436.57128,6401535  1% 1% 0% 100%
2.0Ruby #5 37.0137.04457,952996  1% 1% 0% 100%
2.6PHP 46.6946.71247,8201036  1% 0% 0% 100%
2.6Java  #2 46.8146.85462,6001602  0% 1% 1% 100%
2.6Java  #3 47.0247.05466,8201630  1% 0% 0% 100%
2.6Haskell GHC 47.7547.80362,4601693  0% 1% 1% 100%
2.7Java  #4 48.7448.78180,6601873  0% 0% 1% 100%
2.9C gcc #6 51.9351.97180,3122439  0% 1% 1% 100%
2.9PHP #2 52.2652.29248,0441141  1% 0% 1% 100%
3.1OCaml #3 56.2256.29253,6281789  0% 0% 0% 100%
3.2F# Mono #4 58.8258.881,021,3841505  0% 0% 1% 100%
3.3Fortran Intel #2 59.7559.79195,7562079  0% 0% 0% 100%
3.3Java  #5 60.5860.63181,4242211  0% 1% 1% 100%
3.4F# Mono #3 61.3261.381,025,7281111  0% 1% 1% 100%
3.4Haskell GHC #2 62.0862.15369,3321965  0% 0% 0% 100%
3.8OCaml 69.3569.41443,224870  0% 0% 0% 100%
4.1Go #5 73.7173.77272,6961268  1% 0% 0% 100%
4.2Clojure #7 76.0676.131,012,7723030  1% 1% 0% 100%
4.4Pascal Free Pascal #2 79.9780.04132,5002383  1% 0% 0% 100%
4.5C# Mono #4 80.8580.90533,6681696  0% 1% 1% 100%
4.5OCaml #2 80.7980.90337,8841205  0% 0% 0% 100%
4.5Fortran Intel 81.6681.71186,8642238  0% 0% 0% 100%
4.7C# Mono 85.8185.85531,3561420  0% 1% 0% 100%
4.8Ruby JRuby #4 86.1086.231,875,096449  1% 0% 0% 100%
5.1Haskell GHC #3 92.0992.17322,9082749  0% 1% 1% 100%
5.2C# Mono #3 94.4494.52344,2281404  0% 0% 1% 100%
5.3Racket #4 96.6796.91387,480881  0% 1% 1% 100%
5.8Clojure #6 104.41104.521,007,3921737  1% 1% 0% 100%
5.9C# Mono #5 106.43106.58406,3922445  0% 1% 0% 100%
6.2Ruby #4 111.85111.90503,728449  1% 1% 0% 100%
7.1JavaScript V8 #5 128.05128.1976,4361249  0% 1% 1% 100%
7.3Hack #4 132.73133.20219,5961061  0% 0% 1% 100%
7.6Lisp SBCL #3 136.86136.93310,2481284  1% 3% 1% 100%
7.6Lisp SBCL #2 136.36137.47307,8801277  1% 1% 1% 100%
7.9Go #2 142.68142.78267,7801531  1% 1% 1% 100%
10Racket 189.40189.781,308,968542  0% 1% 1% 100%
11Lua #2 192.80194.92707,636613  0% 0% 0% 100%
11Go 195.30195.44399,016980  0% 1% 1% 100%
12Perl #2 212.24215.90778,052359  0% 0% 0% 100%
14JavaScript V8 #2 261.99262.18533,424451  2% 13% 13% 100%
15JavaScript V8 266.48266.67458,036423  0% 1% 1% 100%
15Clojure #4 268.29268.541,010,2601944  1% 1% 0% 100%
16Dart 290.40290.60413,124595  0% 1% 1% 100%
16Erlang HiPE #3 292.20295.911,096,972932  1% 1% 1% 100%
17PHP #4 5 min5 min247,7321060  0% 0% 0% 100%
19Smalltalk VisualWorks #5 5 min5 min380,8521153  0% 0% 0% 100%
20JavaScript V8 #3 5 min5 min456,392390  4% 25% 19% 100%
20Erlang HiPE 5 min6 min3,646,340930  6% 8% 9% 100%
21Python 3 #8 6 min6 min456,532647  0% 1% 1% 100%
24Python 3 7 min7 min402,016487  1% 0% 0% 100%
24Ruby JRuby 7 min7 min946,844637  1% 1% 0% 100%
24Ruby #2 7 min7 min163,892420  1% 1% 0% 100%
26Ruby JRuby #3 7 min7 min944,788540  1% 0% 0% 100%
27Ruby #3 8 min8 min175,020540  1% 1% 0% 100%
28Ruby 8 min8 min132,992637  1% 0% 1% 100%
C# Mono #2 Failed1012
C++ g++ Make Error2106
Erlang HiPE #2 Failed997
F# Mono Failed701
Hack Bad Output1038
Lisp SBCL Timed Out5 min847
Perl #3 Failed507
Perl Failed648
Perl #4 Failed472
Racket #2 Bad Output842
Ruby JRuby #5 Failed996
Ruby JRuby #2 Failed421
Scala Failed1625
Scala #4 Failed1287
Scala #2 Failed2080
Scala #6 Failed1380
"wrong" (different) algorithm / less comparable programs
 C# Mono #6 Failed  1433
0.4C++ g++ #5 7.317.3252,0883416
0.4Java  7.357.36217,7685211
0.5C gcc #4 8.808.81176,6122409
0.5C gcc #8 8.828.83128,0402040
0.5C++ g++ #6 9.639.64144,0923415
0.7Ada 2005 GNAT 12.1812.20409,7526503
0.9Java  #6 17.1417.16162,7882115
2.8C gcc #5 50.8450.88281,7402519
5.1Python 3 #2 91.6091.75375,452624
5.4JavaScript V8 #4 98.4098.51155,8521177

 k-nucleotide benchmark : Hashtable update and k-nucleotide strings

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 250KB input file (generated with the fasta program N = 25000) 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 FASTA files generated by the fasta benchmark as input for this benchmark. Note: the file may include both lowercase and uppercase codes.

Each program should

In practice, less brute-force would be used to calculate k-nucleotide frequencies, for example Virus Classification using k-nucleotide Frequencies and A Fast Algorithm for the Exhaustive Analysis of 12-Nucleotide-Long DNA Sequences. Applications to Human Genomics (105KB pdf).

Revised BSD license

  Home   Conclusions   License   Play