regex-dna benchmark ≈50MB N=5,000,000

Each chart bar shows how many times slower, one ↓ regex-dna 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 gcc 6.202.59287,9002579  46% 70% 51% 74%
1.5C++ g++ #2 5.383.83171,652695  1% 65% 76% 2%
1.8C++ g++ #4 13.824.6995,1761759  90% 97% 51% 59%
2.1C++ g++ 5.345.35186,252648  1% 0% 1% 100%
2.2Ada 2005 GNAT #5 17.865.61171,9403492  79% 70% 73% 98%
3.1Ada 2005 GNAT #6 23.907.91105,3563740  70% 69% 65% 100%
3.1C gcc #4 23.847.9391,5521525  63% 66% 72% 100%
3.3Scala #5 29.818.54446,2401704  90% 86% 89% 85%
3.4Clojure #4 28.088.84797,168707  72% 72% 88% 86%
3.5Java  #5 26.349.02714,924929  64% 75% 86% 67%
3.8Scala #2 27.269.81571,844668  83% 65% 61% 71%
3.9PHP #4 29.0210.00152,084832  64% 67% 65% 96%
4.0Haskell GHC #2 39.4410.41208,9641518  97% 97% 93% 93%
4.1Python 3 23.4910.58253,208478  47% 39% 94% 43%
4.1Perl #2 27.6210.63142,432527  77% 61% 80% 44%
4.2PHP 12.9410.94222,360788  55% 54% 55% 97%
4.3Erlang HiPE #6 39.8211.17283,5521058  93% 90% 89% 86%
4.7Ruby #3 36.1312.28348,464501  65% 78% 70% 82%
4.9Java  #2 39.8912.61731,6441534  70% 81% 80% 86%
5.0Ruby #8 36.3412.83115,624529  92% 60% 64% 69%
5.3Ruby #7 37.7213.73183,768507  62% 62% 95% 58%
6.4Go #2 48.3516.461,153,468789  65% 65% 78% 87%
6.4Ruby JRuby #7 48.9516.67925,680507  77% 68% 76% 74%
7.7C++ g++ #3 30.8419.98177,740844  94% 1% 60% 1%
8.0Java  #7 21.2420.78562,9881284  17% 1% 84% 1%
8.1Lisp SBCL #3 43.8220.93581,1641948  44% 41% 89% 37%
8.1Java  #8 21.4021.06563,0281377  1% 1% 1% 100%
9.1F# Mono #3 71.3723.602,414,396870  89% 74% 70% 70%
9.2Python 3 #5 23.8323.84247,660424  1% 4% 0% 97%
9.4C# Mono #7 87.2924.47462,916898  89% 88% 88% 93%
9.6Ruby JRuby #3 63.5224.862,161,128501  83% 57% 59% 57%
9.6Ruby JRuby #2 63.2024.972,172,192417  74% 51% 58% 72%
9.8Clojure #3 47.0825.34871,904710  64% 40% 44% 40%
9.8F# Mono 84.2125.41968,460639  83% 84% 85% 81%
10Go #8 85.9026.161,158,596785  77% 85% 75% 92%
11Java  #4 29.4127.77739,244921  13% 5% 3% 87%
11F# Mono #4 89.2227.801,106,068899  84% 85% 77% 76%
11PHP #3 28.4828.49217,104459  0% 0% 1% 100%
11Ruby #6 28.6328.64144,172442  0% 0% 100% 1%
12C gcc #2 30.1830.20125,8921099  0% 1% 0% 100%
13Scala 38.2734.46748,472611  87% 16% 6% 6%
13C# Mono #6 90.4634.55342,492638  79% 64% 60% 60%
13Perl #4 34.5534.57141,784440  1% 1% 1% 100%
14Ruby #2 35.3335.34431,248417  8% 36% 45% 13%
14Ruby #5 36.3436.36152,548343  1% 0% 0% 100%
15PHP #2 39.2639.27215,568449  0% 0% 1% 100%
15Racket 39.5339.52669,152527  1% 100% 1% 1%
16Ruby JRuby #6 47.5741.13841,020442  19% 30% 35% 34%
17Ruby JRuby #5 50.0843.46836,908343  18% 83% 9% 7%
20Ruby 51.1051.12418,408308  0% 0% 100% 1%
20Go 162.8251.401,239,576733  94% 75% 73% 76%
28C# Mono #2 73.1573.17326,040594  2% 49% 7% 44%
28Dart #2 74.8273.61253,904648  1% 5% 1% 96%
29C# Mono 74.1474.171,059,836624  1% 98% 0% 2%
29F# Mono #2 74.5474.571,525,188413  1% 1% 0% 100%
33Go #7 86.7085.831,046,540652  12% 30% 60% 1%
35Ruby JRuby 106.7889.812,210,420308  33% 9% 9% 69%
Erlang HiPE Timed Out5 min622
Java  #6 Failed1410
Lisp SBCL Bad Output591
OCaml #4 Failed1050
OCaml #2 Failed615
OCaml Failed1502
OCaml #3 Failed1014
Racket #2 Bad Output536
Ruby JRuby #8 Failed529
Rust Make Error748
Scala #3 Failed633
Scala #4 Failed723
"wrong" (different) algorithm / less comparable programs
1.1Perl #7 4.242.88141,904567
1.2Java  #3 8.493.17263,5882084
1.2Erlang HiPE #7 7.893.22278,1201198
1.7Perl #6 4.284.29190,284477
8.3Pascal Free Pascal 21.6321.64117,8601199
missing benchmark programs
Fortran Intel No program
Pascal Free Pascal No program

 regex-dna benchmark : Match DNA 8-mers and substitute nucleotides for IUB codes

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 100KB input file (generated with the fasta program N = 10000) 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

Revised BSD license

  Home   Conclusions   License   Play