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

Each chart bar shows how many times more Code, one ↓ k-nucleotide program used, compared to the program that used least Code.

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.0Perl #2 221.40224.30464,944359  4% 31% 37% 29%
1.2Ruby #2 11 min11 min158,504420  0% 1% 0% 100%
1.3Ruby JRuby #4 109.3499.111,917,404449  21% 5% 6% 80%
1.3Ruby #4 184.06187.14501,072449  6% 93% 0% 1%
1.3Perl #4 228.7466.991,051,292472  75% 74% 96% 97%
1.4Python 3 9 min9 min391,748487  1% 100% 0% 0%
1.4Perl #3 255.0274.611,140,456507  96% 89% 83% 76%
1.5Ruby #3 13 min13 min164,540540  22% 28% 30% 21%
1.5Racket 219.87220.011,419,712542  96% 0% 1% 4%
1.7Dart 260.74258.83321,408595  43% 37% 1% 22%
1.8Ruby 13 min238.96129,896637  97% 92% 73% 67%
1.8Python 3 #8 8 min161.33364,488647  89% 60% 98% 56%
1.8Perl 240.8465.841,012,832648  90% 93% 93% 91%
2.0F# Mono 5 min110.39644,644701  76% 73% 72% 74%
2.6Erlang HiPE #3 5 min124.55980,820932  69% 81% 58% 77%
2.7Go 152.6345.14396,976980  97% 76% 90% 76%
2.8C# Mono #2 175.09175.13292,4761012  40% 1% 44% 17%
2.9PHP 46.7441.46246,9721036  91% 13% 4% 6%
3.0PHP #4 5 min87.95246,8281060  92% 100% 80% 83%
3.1F# Mono #3 62.4327.21999,4921111  51% 45% 56% 79%
3.5C++ g++ #3 23.447.22139,1361252  76% 76% 78% 97%
3.5Go #5 50.6719.02274,2121268  93% 83% 45% 46%
3.6Lisp SBCL #2 161.15161.23366,5601277  0% 1% 1% 100%
3.6Lisp SBCL #3 160.20160.29366,5601284  0% 1% 100% 1%
3.9C# Mono #3 101.2634.92319,1761404  97% 65% 61% 68%
4.0C# Mono 113.26113.30517,2041420  8% 0% 1% 93%
4.2F# Mono #4 59.1224.631,007,2601505  50% 55% 46% 90%
4.3Go #2 129.4043.58270,9281531  88% 93% 60% 57%
4.3C gcc #9 35.8912.38130,7561535  94% 63% 91% 43%
4.5Java  #2 45.0512.92516,2081602  95% 88% 85% 81%
4.5Java  #3 45.5413.06516,7721630  85% 98% 85% 84%
4.7Haskell GHC 7 min113.49264,5321693  99% 99% 99% 100%
4.7C# Mono #4 104.3634.12515,5281696  98% 68% 71% 70%
4.8Clojure #6 106.2934.98999,2241737  81% 69% 89% 66%
5.1C# Mono #7 64.9324.05515,5241822  93% 57% 60% 61%
5.1Java  #7 35.8910.661,200,3201844  82% 83% 92% 82%
5.2Java  #4 52.5751.48195,5761873  1% 2% 67% 33%
5.4Python 3 #3 294.0977.49141,2161937  97% 94% 95% 97%
5.4Clojure #4 189.5763.42994,8521944  76% 68% 79% 78%
5.5Haskell GHC #2 76.8120.49268,8201965  97% 93% 94% 92%
5.8Fortran Intel #2 68.1027.09172,0642079  37% 54% 83% 79%
5.9Rust 26.508.74154,5162118  79% 78% 85% 63%
6.2Java  #5 77.9433.76197,5682211  85% 26% 28% 94%
6.2Fortran Intel 113.76113.82192,3202238  1% 0% 0% 100%
6.3Lisp SBCL #4 67.2367.30111,1922272  91% 1% 10% 0%
6.4C gcc #7 40.7214.77165,8002280  90% 46% 96% 45%
6.4Lisp SBCL #5 67.1467.21111,1882301  0% 39% 1% 62%
6.6Pascal Free Pascal #2 46.2246.24130,0682383  0% 100% 1% 1%
6.8C gcc #6 53.4416.99163,7882439  64% 97% 61% 97%
6.8C# Mono #5 183.2252.74333,7202445  91% 84% 87% 88%
7.6Clojure #5 39.8515.07375,7842723  69% 82% 79% 36%
7.7Haskell GHC #3 106.2735.58501,9802749  49% 100% 59% 92%
8.4Clojure #7 99.9831.11993,3763030  82% 72% 81% 89%
14Ada 2005 GNAT #2 21.189.72273,9404865  57% 81% 27% 55%
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 #3 Timed Out1h 00 min540
Ruby JRuby #2 Failed421
Ruby JRuby Timed Out1h 00 min637
Scala #4 Failed1287
Scala #6 Failed1380
Scala Failed1625
Scala #2 Failed2080
"wrong" (different) algorithm / less comparable programs
1.7Python 3 #2 126.3773.25351,796624
4.0C# Mono #6 44.0616.4782,2321433
5.7C gcc #8 16.1616.18125,9962040
5.9Java  #6 19.1619.03156,2202115
6.7C gcc #4 13.333.76155,0002409
7.0C gcc #5 48.2714.80277,2202519
9.5C++ g++ #6 11.623.49132,9843415
9.5C++ g++ #5 9.072.9645,0123416
15Java  14.224.00173,6245211
18Ada 2005 GNAT 10.564.66407,8886503

 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