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 23.607.22132,7401252  78% 77% 76% 98%
1.2Rust 26.248.79155,5602078  81% 83% 60% 76%
1.2Ada 2005 GNAT #2 19.298.91271,5044865  22% 49% 80% 67%
1.5Java  #7 35.2710.611,199,1841844  79% 78% 90% 88%
1.7C gcc #9 36.5812.35131,9041535  37% 71% 95% 94%
1.8Java  #2 44.6212.83518,0361602  94% 85% 84% 85%
1.8Java  #3 44.7912.87517,6321630  95% 86% 84% 84%
2.1Clojure #5 40.4815.35393,5282852  59% 65% 71% 70%
2.1C gcc #7 42.1515.39164,3242280  42% 42% 100% 91%
2.4C gcc #6 55.4017.53168,4362439  97% 94% 62% 64%
2.6Go #5 49.8318.82277,9921268  38% 61% 83% 83%
2.8Haskell GHC #2 76.8120.49268,8201965  97% 93% 94% 92%
3.3F# Mono #4 64.6923.771,144,9281505  65% 53% 97% 59%
3.4C# Mono #7 71.7724.56505,2081822  68% 65% 65% 95%
3.8Fortran Intel #2 68.1027.09172,0642079  37% 54% 83% 79%
3.9F# Mono #3 66.3228.131,145,3921111  69% 47% 91% 30%
4.3Clojure #7 101.8131.321,003,9684387  83% 91% 82% 70%
4.4Clojure #6 96.2931.94999,0082793  72% 69% 77% 86%
4.6Java  #5 77.0832.87209,1482211  54% 69% 24% 89%
4.9C# Mono #4 114.9635.53505,4441696  77% 76% 99% 74%
4.9Haskell GHC #3 106.2735.58501,9802749  49% 100% 59% 92%
5.7PHP 46.7441.46246,9721036  91% 13% 4% 6%
5.8C# Mono #5 135.9641.59330,5602445  95% 79% 80% 78%
6.2Go 154.2844.73404,100980  99% 84% 86% 77%
6.3Go #2 136.6145.40273,9561531  80% 88% 62% 72%
6.4Pascal Free Pascal #2 46.2246.24130,0682383  0% 100% 1% 1%
7.1Clojure #4 160.9751.381,000,3123081  73% 80% 78% 84%
7.6C# Mono #3 172.9655.17419,8401404  76% 75% 90% 75%
8.1Java  #4 59.5258.48196,4041873  2% 2% 100% 1%
9.1Perl 240.8465.841,012,832648  90% 93% 93% 91%
9.3Perl #4 228.7466.991,051,292472  75% 74% 96% 97%
9.3Lisp SBCL #4 67.3667.43114,5082272  0% 0% 100% 1%
9.4Lisp SBCL #5 67.6667.73115,0402301  93% 2% 6% 0%
10Perl #3 255.0274.611,140,456507  96% 89% 83% 76%
10Python 3 #3 291.9475.78148,1921937  97% 97% 100% 97%
12PHP #4 5 min87.95246,8281060  92% 100% 80% 83%
16Ruby JRuby #4 121.34112.691,625,992449  37% 8% 48% 16%
16Haskell GHC 7 min113.49264,5321693  99% 99% 99% 100%
16Fortran Intel 113.76113.82192,3202238  1% 0% 0% 100%
17C# Mono 120.76120.57506,7081420  16% 4% 1% 85%
18Erlang HiPE #3 6 min129.78868,000932  62% 69% 93% 68%
23Lisp SBCL #2 164.32164.40370,0921277  0% 17% 1% 84%
23Lisp SBCL #3 164.79164.93368,5761284  85% 16% 1% 0%
23Python 3 #8 8 min167.03375,368647  87% 54% 97% 59%
26Ruby #4 184.06187.14501,072449  6% 93% 0% 1%
29Racket 206.91206.991,421,872542  87% 4% 11% 1%
31Perl #2 221.40224.30464,944359  4% 31% 37% 29%
33Ruby 13 min238.96129,896637  97% 92% 73% 67%
36Dart 264.31262.40327,412595  1% 23% 74% 4%
97Ruby #2 11 min11 min158,504420  0% 1% 0% 100%
110Ruby #3 13 min13 min164,540540  22% 28% 30% 21%
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
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
0.4C++ g++ #5 9.383.0245,1243416
0.5C++ g++ #6 11.943.56134,5563415
0.5C gcc #4 13.183.73158,3922409
0.6Java  14.544.17176,8845211
0.6Ada 2005 GNAT 9.854.57410,5806503
0.8C gcc #8 15.945.87130,3882040
2.0C gcc #5 50.8014.76277,1482519
2.2C# Mono #6 46.3015.89100,8601433
2.7Java  #6 19.3319.15161,4202115
10Python 3 #2 128.5573.75329,280624

 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