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 24.797.34154,7841252  81% 80% 81% 97%
1.1Go #3 30.718.30256,7521399  91% 99% 91% 91%
1.2Clojure #5 21.878.56403,4682723  68% 36% 84% 69%
1.3Rust 26.069.76152,5362113  42% 83% 43% 99%
1.5Java  #7 36.6510.711,120,9601844  94% 82% 84% 83%
1.5Ada 2005 GNAT #2 29.9311.18276,6924865  61% 64% 59% 85%
1.5C gcc #7 35.0911.37188,4962280  64% 91% 61% 94%
1.7Ruby #5 37.3512.36457,396996  70% 69% 97% 68%
1.7Java  #3 44.0412.47466,3961630  97% 85% 86% 86%
1.7Java  #2 44.2312.57469,0521602  96% 85% 86% 86%
1.9C gcc #9 38.2013.88134,6561535  95% 54% 99% 28%
2.3C gcc #6 54.4716.97192,2762439  96% 65% 62% 100%
2.4Haskell GHC 65.9917.73363,7801693  92% 93% 93% 97%
2.6PHP #2 53.6519.10248,0441141  65% 66% 70% 82%
2.7Haskell GHC #2 74.8220.03365,1121965  96% 92% 95% 92%
2.8OCaml #3 55.5020.29253,6241789  39% 57% 79% 100%
3.1F# Mono #4 58.9122.561,023,4401505  70% 58% 61% 73%
3.5Fortran Intel #2 65.5225.74196,2122079  48% 38% 90% 83%
3.6C# Mono #4 81.0026.62531,0641696  70% 70% 71% 97%
3.6F# Mono #3 60.8426.641,025,6441111  55% 52% 78% 45%
3.7Go #5 72.3527.52272,7441268  38% 44% 83% 100%
4.1Clojure #7 96.8330.151,013,7963030  75% 82% 86% 80%
4.1C# Mono #3 94.0930.45342,3081404  83% 68% 79% 80%
4.2Java  #5 66.5831.07181,3042211  31% 90% 19% 76%
4.5Lisp SBCL #4 33.0833.12152,1802272  1% 1% 1% 100%
4.5Lisp SBCL #5 33.1233.15152,1802301  100% 1% 1% 0%
5.1OCaml #2 82.4737.09325,7401205  26% 80% 36% 82%
6.0PHP 49.0144.15247,8241036  5% 3% 100% 4%
6.3Hack #4 154.2846.24205,8721061  94% 88% 71% 82%
6.3Haskell GHC #3 122.1146.26313,5082749  54% 89% 43% 80%
6.3Go #2 144.1746.27265,3121531  66% 93% 96% 58%
6.5Java  #4 48.3247.88182,2001873  67% 34% 1% 1%
7.2Clojure #6 145.1252.78989,0161737  77% 60% 58% 83%
7.3C# Mono #5 184.0353.66392,7962445  83% 83% 90% 89%
8.3Go 195.1361.00390,420980  93% 69% 88% 71%
9.0Clojure #4 213.8666.091,007,7361944  91% 88% 75% 71%
9.5OCaml 69.4569.51443,232870  96% 0% 0% 4%
9.6Perl 240.6070.321,886,164648  84% 90% 82% 87%
9.7Perl #4 221.6971.041,066,204472  61% 96% 90% 67%
11Ruby JRuby #4 85.3580.181,870,964449  8% 37% 20% 45%
11Pascal Free Pascal #2 80.2280.28132,1562383  1% 1% 0% 100%
12Perl #3 278.3584.541,143,524507  72% 75% 94% 90%
12C# Mono 85.6385.66531,3441420  66% 1% 25% 10%
12Fortran Intel 88.6088.68187,1202238  0% 0% 100% 0%
13PHP #4 5 min94.40247,7241060  97% 76% 76% 82%
15Racket #4 106.84106.83387,480881  0% 0% 1% 100%
15Ruby #4 111.62111.65503,692449  1% 1% 0% 100%
17Python 3 #8 6 min124.40498,756647  59% 58% 87% 98%
19Lisp SBCL #2 136.25136.32307,8761277  1% 0% 100% 1%
19Lisp SBCL #3 136.93138.23307,8761284  1% 7% 94% 1%
19Erlang HiPE #3 6 min138.451,019,072932  61% 56% 65% 86%
21Ruby 8 min152.36132,976637  75% 74% 98% 93%
22Erlang #3 7 min160.221,011,344932  50% 70% 64% 91%
22Erlang HiPE 6 min163.373,622,516930  62% 71% 53% 74%
23Ruby JRuby #3 8 min167.39952,020540  60% 67% 80% 93%
24Ruby JRuby 9 min173.181,100,248637  77% 62% 92% 83%
26Racket 190.80190.941,308,984542  29% 1% 66% 5%
29Erlang 7 min210.373,457,908930  58% 40% 75% 70%
31Perl #2 221.13224.63778,212359  97% 1% 0% 0%
40Dart 292.65291.07410,464595  47% 11% 44% 1%
60Ruby #2 7 min7 min165,112420  86% 14% 1% 0%
62Python 3 7 min7 min402,016487  0% 1% 100% 0%
67Ruby #3 8 min8 min174,660540  30% 20% 22% 30%
C# Mono #2 Failed1012
C++ g++ Make Error2106
Erlang #2 Failed997
Erlang HiPE #2 Failed997
F# Mono Failed701
Hack Bad Output1038
Lisp SBCL Timed Out5 min847
Racket #2 Bad Output842
Ruby JRuby #5 Failed996
Ruby JRuby #2 Failed421
Scala Failed1625
Scala #4 Failed1287
Scala #2 Failed2080
Scala #6 Failed1380
"wrong" (different) algorithm / less comparable programs
 C# Mono #6 Failed  1433
0.3C++ g++ #5 7.412.4652,7283416
0.4C gcc #4 8.712.62175,7482409
0.4C++ g++ #6 10.032.96139,0843415
0.5Java  11.863.37175,9885211
0.7Ada 2005 GNAT 11.285.48409,7206503
1.3C gcc #8 9.479.49128,0442040
2.2C gcc #5 53.5216.39292,2602519
2.3Java  #6 17.7116.78162,2682115
7.0Python 3 #2 93.3351.67376,064624

 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