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 17.9417.96153,6161252  1% 1% 0% 100%
1.2Clojure #5 21.4221.44400,0042723  0% 1% 0% 100%
1.5Rust 26.5726.59154,0402078  0% 1% 1% 100%
1.5Ada 2005 GNAT #2 27.0827.12278,3244865  1% 0% 0% 100%
1.7Go #3 30.7530.77254,5801399  0% 0% 1% 100%
1.8C gcc #7 32.0132.04181,1082280  1% 0% 0% 100%
1.9Lisp SBCL #4 33.8033.84153,1522272  0% 1% 1% 100%
1.9Lisp SBCL #5 33.9233.95153,1482301  0% 1% 1% 100%
1.9Java  #7 34.7934.831,124,1041844  1% 1% 0% 100%
2.0C gcc #9 35.0335.06129,6441535  1% 1% 0% 100%
2.3PHP 41.3341.35247,8521036  1% 0% 0% 100%
2.5Haskell GHC 45.3545.40267,7361693  0% 1% 1% 100%
2.6Java  #2 46.7946.83468,3081602  1% 1% 0% 100%
2.6Java  #3 47.4047.44467,0241630  1% 1% 0% 100%
2.7Java  #4 48.9248.96185,5041873  1% 1% 0% 100%
2.9C gcc #6 51.7551.78181,1722439  1% 1% 0% 100%
3.0OCaml #3 54.2354.28362,4401789  1% 0% 0% 100%
3.1C# Mono #7 55.4455.48505,5081822  2% 1% 1% 100%
3.1Fortran Intel #2 56.2656.30192,8522079  0% 0% 1% 100%
3.2Java  #5 57.9758.03218,6362211  1% 1% 1% 100%
3.3Haskell GHC #2 59.4959.55269,0441965  0% 1% 1% 100%
3.8OCaml 68.3968.45464,580870  0% 1% 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.3OCaml #2 77.1277.21325,5161205  0% 1% 0% 100%
4.5Pascal Free Pascal #2 79.9780.04132,5002383  1% 0% 0% 100%
4.6Fortran Intel 83.4283.47186,9362238  0% 0% 1% 100%
4.7Racket #4 84.8384.88405,004881  0% 1% 1% 100%
4.8Ruby JRuby #4 86.1086.231,875,096449  1% 0% 0% 100%
4.9C# Mono #4 88.4688.51508,2761696  2% 1% 1% 100%
4.9Haskell GHC #3 88.6688.74352,1762749  0% 1% 1% 100%
5.1C# Mono 91.3691.40524,0121420  2% 2% 0% 100%
5.1JavaScript V8 #5 91.6491.7571,0921249  1% 1% 1% 100%
5.7C# Mono #3 101.47101.55598,3321404  1% 1% 0% 100%
5.8Clojure #6 104.41104.521,007,3921737  1% 1% 0% 100%
6.0Ruby #4 108.59108.62501,712449  0% 1% 1% 100%
7.4Hack #4 132.73133.20219,5961061  0% 0% 1% 100%
7.5Lisp SBCL #2 133.93134.00376,1961277  0% 0% 0% 100%
7.5Lisp SBCL #3 134.07134.14376,1961284  1% 2% 1% 100%
7.9Go #2 142.68142.78267,7801531  1% 1% 1% 100%
9.7Lua #2 173.24174.70793,696613  1% 1% 0% 100%
10C# Mono #2 186.99188.14399,5521012  1% 1% 1% 100%
11Racket 189.33189.641,313,572542  0% 1% 1% 100%
11Go 195.30195.44399,016980  0% 1% 1% 100%
12Perl #2 209.48213.01534,952359  0% 1% 1% 100%
15JavaScript V8 #2 259.54262.15532,908451  1% 1% 0% 100%
15Clojure #4 268.29268.541,010,2601944  1% 1% 0% 100%
15JavaScript V8 269.43269.63458,464423  1% 0% 0% 100%
15Python 3 #3 269.61272.54213,8601937  1% 1% 1% 100%
15C# Mono #5 273.54273.78365,3442445  2% 2% 0% 100%
16Dart 284.44284.87423,888595  0% 1% 1% 100%
16Erlang HiPE #3 292.20295.911,096,972932  1% 1% 1% 100%
17PHP #4 299.185 min247,7121060  1% 1% 0% 100%
18Smalltalk VisualWorks #5 5 min5 min384,2881153  0% 1% 0% 100%
20JavaScript V8 #3 6 min6 min461,500390  1% 1% 0% 100%
20Erlang HiPE 5 min6 min3,646,340930  6% 8% 9% 100%
21Python 3 #8 6 min6 min445,236647  1% 1% 0% 100%
21Ruby #2 6 min6 min166,108420  0% 1% 0% 100%
24Ruby JRuby 7 min7 min946,844637  1% 1% 0% 100%
25Ruby #3 7 min7 min171,776540  0% 1% 1% 100%
25Ruby 7 min7 min132,188637  0% 1% 1% 100%
26Ruby JRuby #3 7 min7 min944,788540  1% 0% 0% 100%
C++ g++ Make Error2106
Erlang HiPE #2 Failed997
F# Mono Failed701
F# Mono #4 Failed1505
F# Mono #3 Failed1111
Hack Bad Output1038
Lisp SBCL Bad Output847
Perl #3 Failed507
Perl Failed648
Perl #4 Failed472
Racket #2 Bad Output842
Ruby JRuby #2 Failed421
Scala Failed1625
Scala #4 Failed1287
Scala #2 Failed2080
Scala #6 Failed1380
"wrong" (different) algorithm / less comparable programs
0.4C++ g++ #5 6.966.9753,2083416
0.4Java  7.547.55227,1445211
0.5C gcc #4 8.748.76177,2202409
0.5C gcc #8 9.029.04129,0842040
0.5C++ g++ #6 9.389.39143,6923415
0.7Ada 2005 GNAT 11.6811.70413,4126503
1.0Java  #6 17.3717.39169,9682115
1.9C# Mono #6 33.7034.49124,5041433
2.8C gcc #5 50.6850.71282,8002519
5.0Python 3 #2 89.7389.78377,140624
5.2JavaScript V8 #4 93.3793.48155,1481177

 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