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.1Go #3 29.978.14259,8841399  91% 93% 93% 92%
1.2Clojure #5 22.518.81360,4602852  82% 69% 38% 69%
1.3Rust 24.849.44155,7962078  41% 41% 99% 84%
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 55.3319.39516,4201822  87% 63% 65% 72%
2.8OCaml #3 54.0720.22362,3241789  93% 88% 40% 49%
3.3F# Mono #4 66.0823.61863,2561505  64% 64% 77% 76%
3.3Fortran Intel #2 61.7023.90194,1402079  80% 49% 64% 67%
3.7Go #5 69.1226.56274,5561268  84% 99% 43% 36%
3.9C# Mono #4 89.4027.94516,9881696  98% 74% 75% 74%
4.0Java  #5 65.0028.49220,2682211  77% 45% 65% 43%
4.0F# Mono #3 67.6728.56867,8961111  45% 91% 75% 27%
4.2Clojure #7 98.0130.131,019,1044387  75% 82% 83% 87%
4.5C# Mono #3 102.6232.46536,4601404  89% 86% 66% 76%
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.6Go #2 124.9740.16265,9041531  60% 58% 100% 94%
5.6C# Mono #5 132.3640.31365,9442445  91% 78% 81% 80%
5.9Hack #4 136.7342.43331,5041061  68% 88% 73% 96%
6.1Clojure #6 118.0543.801,016,7802793  70% 86% 47% 69%
6.5Java  #4 47.2346.71182,9321873  95% 2% 6% 1%
7.7Go 179.8555.39265,824980  91% 68% 99% 67%
7.8Clojure #4 173.8455.531,017,2443081  81% 79% 77% 78%
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%
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%
12F# Mono 251.8885.87660,772701  73% 85% 73% 64%
12Fortran Intel 86.3086.35162,8242238  0% 0% 100% 1%
12Racket #4 88.9588.94402,040881  100% 0% 1% 0%
13C# Mono 91.2891.10521,6881420  1% 93% 8% 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%
21Erlang HiPE #3 6 min152.521,126,548932  59% 79% 57% 69%
23Erlang #3 7 min164.121,036,744932  88% 58% 60% 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 187.12187.28522,0281012  18% 47% 36% 1%
28Racket 196.90197.071,309,092542  92% 1% 1% 8%
31Erlang HiPE 7 min221.133,569,412930  71% 57% 54% 59%
33Perl #2 236.75236.97535,684359  1% 0% 100% 1%
36Erlang 8 min257.433,684,436930  62% 68% 82% 65%
40Dart 290.42288.40428,116595  52% 3% 4% 44%
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 44.5214.91120,7121433
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