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.

     sortsortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0Ada 2005 GNAT #2 21.189.72273,9404865  57% 81% 27% 55%
1.1C++ g++ #3 23.447.22139,1361252  76% 76% 78% 97%
1.3Rust 27.089.04148,3162113  62% 82% 60% 98%
1.7C gcc #9 35.8912.38130,7561535  94% 63% 91% 43%
1.7Java  #7 35.8910.661,200,3201844  82% 83% 92% 82%
1.9Clojure #5 39.8515.07375,7842723  69% 82% 79% 36%
1.9C gcc #7 40.7214.77165,8002280  90% 46% 96% 45%
2.1Java  #2 45.0512.92516,2081602  95% 88% 85% 81%
2.2Java  #3 45.5413.06516,7721630  85% 98% 85% 84%
2.2Pascal Free Pascal #2 46.2246.24130,0682383  0% 100% 1% 1%
2.3PHP 48.5943.11246,9681036  4% 4% 90% 16%
2.4Go #5 50.6719.02274,2121268  93% 83% 45% 46%
2.5Java  #4 52.5751.48195,5761873  1% 2% 67% 33%
2.5Ruby #5 52.7817.28356,824996  69% 71% 69% 98%
2.5C gcc #6 53.4416.99163,7882439  64% 97% 61% 97%
2.6PHP #2 55.4120.16247,1841141  62% 65% 58% 91%
2.8F# Mono #4 59.1224.631,007,2601505  50% 55% 46% 90%
2.9F# Mono #3 62.4327.21999,4921111  51% 45% 56% 79%
3.2Lisp SBCL #5 67.1467.21111,1882301  0% 39% 1% 62%
3.2Lisp SBCL #4 67.2367.30111,1922272  91% 1% 10% 0%
3.3Haskell GHC #2 70.5319.10260,1881965  91% 91% 91% 98%
3.3Fortran Intel #2 70.6828.99158,1242079  35% 42% 99% 68%
3.7Java  #5 77.9433.76197,5682211  85% 26% 28% 94%
4.7Clojure #7 99.9831.11993,3763030  82% 72% 81% 89%
4.7Ruby JRuby #4 100.3592.161,824,852449  25% 29% 48% 9%
4.8C# Mono #3 101.2634.92319,1761404  97% 65% 61% 68%
4.9C# Mono #4 104.3634.12515,5281696  98% 68% 71% 70%
5.0Clojure #6 106.2934.98999,2241737  81% 69% 89% 66%
5.3C# Mono 113.26113.30517,2041420  8% 0% 1% 93%
5.4Haskell GHC #3 113.8037.68496,0202749  59% 83% 61% 100%
5.8Fortran Intel 122.78122.86166,9522238  92% 0% 8% 0%
6.1Go #2 129.4043.58270,9281531  88% 93% 60% 57%
7.2Go 152.6345.14396,976980  97% 76% 90% 76%
7.6Lisp SBCL #3 160.20160.29366,5601284  0% 1% 100% 1%
7.6Lisp SBCL #2 161.15161.23366,5601277  0% 1% 1% 100%
8.3C# Mono #2 175.09175.13292,4761012  40% 1% 44% 17%
8.7C# Mono #5 183.2252.74333,7202445  91% 84% 87% 88%
9.0Clojure #4 189.5763.42994,8521944  76% 68% 79% 78%
9.3Ruby #4 197.74197.79501,532449  0% 1% 100% 0%
10Racket 219.87220.011,419,712542  96% 0% 1% 4%
11Perl #2 223.14226.16708,152359  65% 0% 0% 34%
11Perl #4 234.9278.201,049,332472  81% 95% 65% 61%
11Perl 242.0769.891,774,668648  82% 88% 85% 92%
12Dart 252.27250.50317,204595  2% 78% 5% 18%
13Perl #3 280.1690.611,126,916507  95% 80% 70% 65%
14PHP #4 5 min87.70246,8841060  78% 94% 84% 88%
15F# Mono 5 min110.39644,644701  76% 73% 72% 74%
17Erlang HiPE #3 5 min124.55980,820932  69% 81% 58% 77%
20Haskell GHC 7 min111.20264,4361693  97% 96% 96% 97%
23Python 3 #8 8 min161.33364,488647  89% 60% 98% 56%
25Ruby JRuby 8 min170.50878,712637  74% 89% 70% 76%
25Ruby JRuby #3 8 min173.58881,064540  87% 72% 87% 57%
26Python 3 9 min9 min391,748487  1% 100% 0% 0%
36Ruby #2 12 min12 min160,396420  100% 1% 1% 0%
39Ruby 13 min249.47130,416637  69% 69% 95% 97%
40Ruby #3 13 min13 min169,176540  27% 24% 26% 24%
C++ g++ Make Error2106
Erlang HiPE Failed930
Erlang HiPE #2 Failed997
Go #3 Bad Output1399
Lisp SBCL Timed Out5 min847
OCaml #3 Failed1789
OCaml Failed870
OCaml #2 Failed1205
Racket #2 Bad Output842
Racket #4 Bad Output881
Ruby JRuby #5 Failed996
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 9.072.9645,0123416
0.5Ada 2005 GNAT 10.564.66407,8886503
0.5C++ g++ #6 11.623.49132,9843415
0.6C gcc #4 13.333.76155,0002409
0.7Java  14.224.00173,6245211
0.8C gcc #8 16.1616.18125,9962040
0.9Java  #6 19.1619.03156,2202115
2.1C# Mono #6 44.0616.4782,2321433
2.3C gcc #5 48.2714.80277,2202519
6.0Python 3 #2 126.3773.25351,796624

 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