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.0Ada 2005 GNAT #2 22.2722.30273,8764865  0% 1% 1% 100%
1.1C++ g++ #3 24.0324.04138,9601252  1% 1% 0% 100%
1.2Rust 27.7327.75148,2842113  1% 1% 0% 100%
1.4Java  #7 31.1831.211,189,8121844  1% 1% 0% 100%
1.6C gcc #9 35.2235.23126,7881535  0% 2% 1% 100%
1.7C gcc #7 38.0938.12153,4162280  1% 1% 0% 100%
1.8Clojure #5 40.1940.22389,9322723  1% 1% 0% 100%
2.0PHP 44.2744.30246,9601036  0% 1% 1% 100%
2.1Pascal Free Pascal #2 46.1746.20130,2602383  1% 0% 0% 100%
2.3C gcc #6 51.1351.16153,4202439  1% 1% 0% 100%
2.3Ruby #5 51.9752.02357,432996  0% 1% 1% 100%
2.3Java  #4 52.1652.20196,2761873  1% 0% 0% 100%
2.4Java  #3 52.5652.59936,8281630  1% 0% 0% 100%
2.4Java  #2 52.5752.60933,5121602  1% 1% 0% 100%
2.4Go #5 52.8352.87270,2961268  1% 1% 0% 100%
2.4PHP #2 53.5253.55247,1801141  0% 1% 1% 100%
2.7Fortran Intel #2 60.7860.82166,8682079  1% 0% 0% 100%
2.8F# Mono #4 61.6861.71980,4681505  0% 1% 1% 100%
2.9F# Mono #3 63.5863.621,007,1721111  1% 0% 1% 100%
2.9Haskell GHC #2 64.2364.30324,4241965  0% 1% 0% 100%
2.9Lisp SBCL #4 65.3465.41108,8122272  1% 0% 1% 100%
2.9Lisp SBCL #5 65.6165.68108,8042301  1% 0% 0% 100%
3.1Java  #5 68.2468.29196,6162211  1% 1% 0% 100%
3.5Haskell GHC #3 78.4578.52340,1282749  0% 1% 1% 100%
3.6Clojure #7 81.1381.18995,6643030  0% 1% 1% 100%
3.9Clojure #6 87.5987.67999,3961737  0% 1% 1% 100%
4.3Ruby JRuby #4 96.7096.801,824,852449  1% 1% 1% 100%
4.4JavaScript V8 #5 99.1199.2038,8561249  0% 1% 1% 100%
4.6C# Mono #3 103.48103.54319,1121404  1% 1% 1% 100%
4.7C# Mono #4 104.69104.73515,7961696  1% 1% 1% 100%
5.0C# Mono #5 110.99111.09333,9162445  0% 1% 1% 100%
5.1C# Mono 113.30113.34517,1401420  1% 0% 0% 100%
5.2Fortran Intel 114.85114.91179,3762238  0% 0% 0% 100%
7.2Go #2 157.82160.81269,1721531  1% 1% 1% 100%
7.3Lisp SBCL #3 161.61161.71363,1041284  1% 0% 0% 100%
7.3Lisp SBCL #2 162.05162.13363,1041277  1% 1% 0% 100%
7.4Go 164.30164.40393,224980  1% 1% 0% 100%
7.7Clojure #4 172.18172.31996,7641944  1% 1% 1% 100%
7.9C# Mono #2 174.98175.10292,4801012  0% 1% 1% 100%
8.7F# Mono 193.80194.22645,440701  0% 1% 1% 100%
9.4Racket 208.22208.501,419,664542  0% 1% 1% 100%
9.4Perl #2 206.30209.52707,940359  0% 0% 0% 100%
10Lua #2 220.11220.81707,928613  0% 0% 0% 100%
10Ruby #4 200.90225.71501,316449  0% 1% 1% 100%
12Dart 265.27265.44317,384595  0% 1% 1% 100%
12Erlang HiPE #3 267.32267.521,045,072932  0% 0% 0% 100%
14JavaScript V8 5 min5 min337,744423  0% 1% 1% 100%
14JavaScript V8 #2 5 min5 min452,716451  0% 1% 1% 100%
14PHP #4 5 min5 min246,8721060  1% 0% 0% 100%
14Smalltalk VisualWorks #5 5 min5 min343,3201153  0% 0% 0% 100%
18JavaScript V8 #3 6 min6 min355,420390  0% 1% 1% 100%
18Haskell GHC 6 min6 min258,2241693  0% 1% 1% 100%
22Python 3 #8 8 min8 min431,792647  0% 1% 1% 100%
22Ruby JRuby #3 8 min8 min908,756540  1% 1% 1% 100%
24Ruby JRuby 8 min8 min884,948637  1% 1% 1% 100%
25Python 3 9 min9 min383,028487  0% 1% 1% 100%
34Ruby #2 12 min12 min160,544420  0% 1% 1% 100%
37Ruby #3 13 min13 min168,816540  0% 1% 1% 100%
37Ruby 13 min13 min129,992637  0% 1% 1% 100%
C CINT Timed Out1h 00 min1224
C++ g++ Make Error2106
Erlang HiPE Failed930
Erlang HiPE #2 Failed997
Go #3 Bad Output1399
Lisp SBCL Bad Output847
OCaml #3 Failed1789
OCaml Failed870
OCaml #2 Failed1205
Perl #4 Failed472
Perl Failed648
Perl #3 Failed507
Racket #2 Bad Output842
Racket #4 Bad Output881
Ruby JRuby #5 Failed996
Ruby JRuby #2 Failed421
Scala #4 Failed1287
Scala #6 Failed1380
Scala Failed1625
Scala #2 Failed2080
"wrong" (different) algorithm / less comparable programs
0.4C++ g++ #5 8.598.5943,1283416
0.4Java  9.899.90172,9525211
0.5Ada 2005 GNAT 10.9610.97407,4326503
0.5C++ g++ #6 11.1911.20132,6123415
0.6C gcc #4 13.4313.45164,0882409
0.7C gcc #8 16.2216.23125,9962040
0.9Java  #6 19.7619.78154,3882115
1.7C# Mono #6 37.5838.3589,1521433
2.1C gcc #5 47.4547.48267,0362519
3.9JavaScript V8 #4 87.7587.8383,2401177
5.4Python 3 #2 121.03121.20369,756624

 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