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.0Ada 2005 GNAT #2 21.0321.06271,6364865  0% 1% 0% 100%
1.1C++ g++ #3 24.1224.14139,4681252  0% 1% 1% 100%
1.3Rust 27.1827.20149,4602078  0% 1% 1% 100%
1.6Java  #7 33.4433.481,190,0321844  1% 1% 0% 100%
1.7C gcc #9 35.6335.65127,8521535  0% 1% 1% 100%
1.9C gcc #7 39.7739.80154,1922280  1% 0% 0% 100%
1.9Clojure #5 39.9339.97395,6882852  1% 0% 1% 100%
2.2PHP 45.6645.69246,9721036  0% 0% 1% 100%
2.2Pascal Free Pascal #2 46.1746.20130,2602383  1% 0% 0% 100%
2.2Java  #2 46.3546.38519,0521602  0% 1% 0% 100%
2.3Java  #3 47.5447.58518,5881630  1% 1% 0% 100%
2.4Go #5 51.2051.24278,3521268  0% 1% 1% 100%
2.5C gcc #6 53.3053.34154,2642439  0% 0% 0% 100%
2.8Java  #4 58.7258.78196,3721873  1% 1% 0% 100%
2.8Fortran Intel #2 59.6659.69156,6082079  0% 1% 1% 100%
3.2Java  #5 66.3066.36199,6202211  1% 1% 0% 100%
3.2F# Mono #4 66.7866.831,145,1041505  0% 1% 0% 100%
3.2Lisp SBCL #4 67.3667.43115,0442272  0% 0% 1% 100%
3.2Lisp SBCL #5 67.6167.69115,0402301  0% 0% 1% 100%
3.3F# Mono #3 68.5668.671,145,7641111  1% 1% 1% 100%
3.3Haskell GHC #2 68.9669.02372,5641965  0% 1% 1% 100%
3.4C# Mono #7 72.0872.11505,5481822  0% 1% 1% 100%
3.7Haskell GHC #3 77.9077.96348,9162749  0% 1% 0% 100%
3.9Clojure #6 82.2382.331,002,6522793  1% 0% 0% 100%
4.0Clojure #7 83.7683.831,004,0204387  0% 1% 1% 100%
5.2Fortran Intel 109.43109.49168,4202238  0% 0% 1% 100%
5.3C# Mono #3 111.93111.99518,3041404  0% 1% 1% 100%
5.3Ruby JRuby #4 112.13112.231,631,204449  0% 1% 1% 100%
5.5C# Mono #4 115.29115.33505,4961696  0% 1% 1% 100%
5.6C# Mono 118.83118.87506,3521420  0% 1% 1% 100%
5.7JavaScript V8 #5 120.41120.5425,2481249  1% 1% 1% 100%
6.8Go #2 140.52143.49273,9361531  1% 1% 1% 100%
6.9Clojure #4 145.41146.05996,7443081  1% 2% 1% 100%
7.6Go 159.03159.12404,780980  0% 1% 1% 100%
7.8Lisp SBCL #2 164.20164.29369,6081277  0% 1% 1% 100%
7.8Lisp SBCL #3 164.61164.69369,6081284  1% 1% 1% 100%
8.7Ruby #4 182.68182.73501,036449  0% 0% 1% 100%
9.8Racket 205.82206.071,422,360542  0% 1% 1% 100%
10Perl #2 211.38214.42465,444359  0% 1% 1% 100%
11C# Mono #5 225.57225.72330,5762445  0% 1% 1% 100%
12Lua #2 242.00242.46724,636613  0% 1% 1% 100%
12Dart 260.62260.78327,832595  1% 1% 1% 100%
13JavaScript V8 #2 274.86275.03441,276451  0% 1% 1% 100%
13JavaScript V8 275.34275.52342,948423  0% 1% 1% 100%
14Smalltalk VisualWorks #5 288.87289.20347,6241153  1% 1% 1% 100%
14Python 3 #3 295.95296.24152,2961937  1% 1% 1% 100%
14Erlang HiPE #3 295.01298.15932,124932  0% 1% 1% 100%
15PHP #4 5 min5 min246,8161060  1% 1% 0% 100%
18JavaScript V8 #3 6 min6 min361,284390  0% 1% 1% 100%
20Haskell GHC 7 min7 min258,1601693  1% 0% 1% 100%
24Python 3 #8 8 min8 min385,868647  1% 1% 0% 100%
24Ruby JRuby 8 min8 min967,856637  0% 1% 1% 100%
25Ruby JRuby #3 8 min8 min969,300540  0% 1% 1% 100%
33Ruby #2 11 min11 min158,820420  0% 0% 1% 100%
38Ruby #3 13 min13 min162,496540  1% 1% 1% 100%
38Ruby 13 min13 min130,116637  1% 1% 0% 100%
C CINT Timed Out1h 00 min1224
C# Mono #2 Failed1012
C++ g++ Make Error2106
Erlang HiPE Failed930
Erlang HiPE #2 Failed997
F# Mono Failed701
Go #3 Bad Output1399
Lisp SBCL Bad Output847
OCaml #3 Failed1789
OCaml Failed870
OCaml #2 Failed1205
Perl #4 Failed472
Perl Failed648
Perl #3 Failed507
Racket #2 Bad Output842
Racket #4 Bad Output881
Ruby JRuby #2 Failed421
Scala #4 Failed1287
Scala #6 Failed1380
Scala Failed1625
Scala #2 Failed2080
"wrong" (different) algorithm / less comparable programs
0.4C++ g++ #5 8.888.8944,6643416
0.5Java  9.979.98176,8405211
0.5Ada 2005 GNAT 10.2010.21411,1846503
0.5C++ g++ #6 11.5311.54134,0643415
0.6C gcc #4 13.2813.29163,6802409
0.7C gcc #8 15.7015.71127,1642040
1.0Java  #6 21.7621.79158,7722115
1.8C# Mono #6 38.2138.29103,2361433
2.4C gcc #5 49.4749.50268,0362519
5.2JavaScript V8 #4 108.94109.0546,7081177
6.3Python 3 #2 131.92133.14374,328624

 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