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.427.16153,8961252  92% 88% 82% 81%
1.2Go #3 30.718.30256,7521399  91% 99% 91% 91%
1.2Clojure #5 21.878.56403,4682723  68% 36% 84% 69%
1.4Rust 26.009.89155,8682078  88% 53% 43% 81%
1.6Java  #7 38.6611.291,118,2881844  83% 97% 82% 82%
1.6Ada 2005 GNAT #2 25.6811.63278,4684865  100% 19% 42% 62%
1.6C gcc #7 35.0511.64190,2242280  59% 96% 96% 53%
1.8Java  #3 44.0012.57465,3561630  87% 84% 96% 84%
1.8Java  #2 44.3912.79465,1041602  82% 88% 83% 95%
1.9C gcc #9 36.2413.34135,6121535  68% 81% 96% 28%
2.3Haskell GHC 61.0916.46276,5481693  92% 97% 92% 92%
2.4C gcc #6 54.3516.85191,2442439  68% 94% 97% 65%
2.7Haskell GHC #2 71.9419.32274,0601965  93% 96% 93% 92%
2.7C# Mono #7 56.6419.65517,8801822  64% 64% 98% 63%
2.8OCaml #3 54.0720.22362,3241789  93% 88% 40% 49%
3.3Fortran Intel #2 61.7023.90194,1402079  80% 49% 64% 67%
3.3F# Mono #4 66.0323.98864,9601505  71% 60% 74% 72%
3.8Go #5 72.3527.52272,7441268  38% 44% 83% 100%
3.9C# Mono #4 88.4527.68519,3801696  72% 76% 98% 74%
4.0Java  #5 65.0028.49220,2682211  77% 45% 65% 43%
4.1F# Mono #3 67.4229.181,167,6121111  45% 93% 46% 49%
4.2Clojure #7 96.8330.151,013,7963030  75% 82% 86% 80%
4.7Lisp SBCL #4 33.7233.75153,1522272  1% 0% 0% 100%
4.7Lisp SBCL #5 33.9333.97153,1482301  0% 100% 0% 1%
4.9OCaml #2 83.0134.87326,4201205  25% 72% 42% 100%
5.2PHP 42.5737.50247,8561036  91% 4% 7% 13%
5.6Haskell GHC #3 115.0939.86373,2402749  97% 91% 54% 48%
5.7C# Mono #5 135.7440.97372,0602445  94% 80% 79% 81%
6.0Hack #4 143.2743.14346,7321061  86% 95% 80% 72%
6.5Go #2 144.1746.27265,3121531  66% 93% 96% 58%
6.5Java  #4 47.2346.71182,9321873  95% 2% 6% 1%
7.4Clojure #6 145.1252.78989,0161737  77% 60% 58% 83%
8.5Go 195.1361.00390,420980  93% 69% 88% 71%
9.2Clojure #4 213.8666.091,007,7361944  91% 88% 75% 71%
9.5Perl #4 221.4368.001,067,916472  69% 68% 97% 92%
9.6OCaml 68.6268.68464,664870  1% 0% 100% 1%
10Perl 248.4971.281,130,696648  84% 91% 90% 87%
10C# Mono #3 222.0772.28382,8841404  93% 60% 79% 77%
10Python 3 #3 272.6073.07226,1441937  92% 93% 94% 97%
11Perl #3 262.4775.471,144,860507  84% 90% 100% 75%
11Ruby JRuby #4 85.3580.181,870,964449  8% 37% 20% 45%
11Pascal Free Pascal #2 80.2280.28132,1562383  1% 1% 0% 100%
12PHP #4 291.7884.18208,1001060  95% 80% 92% 81%
12Racket #4 84.6384.63405,832881  0% 1% 1% 100%
12Fortran Intel 86.3086.35162,8242238  0% 0% 100% 1%
13C# Mono 91.3191.12522,2041420  100% 1% 1% 1%
15Ruby #4 109.07109.11503,176449  0% 1% 1% 100%
17Python 3 #8 6 min119.34439,876647  86% 62% 98% 60%
19Ruby 7 min133.42131,848637  96% 75% 75% 97%
19Lisp SBCL #2 133.94134.01376,1961277  100% 1% 1% 1%
19Lisp SBCL #3 134.19135.43376,1961284  1% 1% 8% 92%
19Erlang HiPE #3 6 min138.451,019,072932  61% 56% 65% 86%
22Erlang #3 7 min160.221,011,344932  50% 70% 64% 91%
23Erlang 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%
26C# Mono #2 183.77183.93544,4961012  100% 1% 1% 1%
26Racket 188.31188.461,315,976542  93% 1% 1% 8%
29Erlang 7 min210.373,457,908930  58% 40% 75% 70%
33Perl #2 236.75236.97535,684359  1% 0% 100% 1%
40Dart 290.02287.90422,808595  3% 19% 79% 1%
42F# Mono 12 min5 min656,900701  72% 69% 58% 55%
54Ruby #2 6 min6 min166,540420  0% 1% 1% 100%
62Ruby #3 7 min7 min171,864540  29% 21% 21% 30%
C++ g++ Make Error2106
Erlang #2 Failed997
Erlang HiPE #2 Failed997
Hack Bad Output1038
Lisp SBCL Bad Output847
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.3C++ g++ #5 6.902.2854,6443416
0.4C gcc #4 8.422.57176,6282409
0.4C++ g++ #6 9.672.80140,4003415
0.5Java  11.783.39180,4445211
0.6C gcc #8 9.384.07133,6522040
0.7Ada 2005 GNAT 10.695.11413,2246503
2.1C# Mono #6 43.5214.91119,0201433
2.2Java  #6 16.1616.02169,1122115
2.2C gcc #5 53.1516.09292,1242519
7.0Python 3 #2 90.7449.97375,076624

 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