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.4Haskell GHC #2 33.458.76200,3921518  96% 93% 96% 98%
3.4Scala #5 30.338.78461,4121704  86% 82% 96% 83%
3.5Clojure #4 28.529.02634,928707  72% 75% 72% 97%
3.5Java  #5 26.449.20713,236929  80% 66% 77% 65%
3.7PHP #4 26.749.65150,664832  60% 53% 95% 70%
4.2PHP 12.1410.77215,748788  62% 47% 57% 82%
4.2Python 3 23.8111.01248,260478  37% 72% 45% 64%
4.8Java  #2 39.1612.47710,7481534  79% 70% 74% 92%
5.3Perl #2 34.5613.84140,296527  36% 77% 59% 78%
6.3Scala #2 36.3416.40864,252668  46% 68% 41% 68%
6.5Rust 46.7416.83234,528878  80% 59% 63% 83%
7.7Ruby #3 42.9019.90271,304501  37% 41% 100% 38%
7.7C++ g++ #3 30.8419.98177,740844  94% 1% 60% 1%
8.0Lisp SBCL #3 42.5320.71826,9881948  40% 39% 88% 40%
8.1Java  #7 21.2520.93558,5001284  97% 2% 4% 1%
8.8F# Mono #3 68.5822.812,259,604870  77% 76% 79% 70%
9.0Ruby JRuby #3 62.6023.382,049,368501  61% 60% 63% 84%
9.2Ruby JRuby #2 62.9923.752,003,700417  57% 63% 82% 64%
9.2Python 3 #5 23.9623.97247,792424  0% 1% 1% 100%
9.4Java  #4 25.8224.24725,364921  92% 6% 3% 7%
10Go #8 84.8025.701,328,428785  96% 77% 77% 81%
10Clojure #3 49.0125.90901,928710  29% 60% 62% 40%
10F# Mono 89.0026.37946,124639  83% 83% 81% 91%
10PHP #3 26.4826.50212,432459  0% 0% 0% 100%
11Ruby #6 28.2728.28162,528442  0% 0% 0% 100%
12C gcc #2 30.1830.20125,8921099  0% 1% 0% 100%
13C# Mono #6 92.1434.20342,480638  61% 85% 65% 59%
13PHP #2 34.5534.57221,796449  0% 1% 1% 100%
14Scala 39.0135.12747,980611  18% 61% 5% 29%
14Ruby #5 35.9435.95103,552343  0% 0% 100% 0%
15Racket 39.8639.85669,612527  1% 1% 1% 100%
16Ruby JRuby #5 47.6742.28909,128343  13% 90% 5% 7%
17Ruby #2 42.8442.86348,968417  15% 19% 21% 46%
19Go 153.3249.001,328,916733  75% 85% 71% 83%
20Erlang HiPE #6 185.5452.36208,5721058  82% 97% 95% 80%
21Ruby JRuby #6 59.2053.68927,640442  32% 5% 43% 31%
22Ruby 57.2757.29319,148308  0% 0% 0% 100%
27C# Mono #2 71.2571.27260,620594  1% 1% 45% 55%
28F# Mono #2 72.4072.451,600,276413  1% 100% 0% 1%
28C# Mono 72.6872.71852,188624  78% 21% 2% 1%
33Go #7 85.3884.451,217,964652  4% 1% 97% 1%
33Ruby JRuby 93.4585.072,101,424308  14% 89% 4% 5%
33Perl #4 86.1886.21189,272440  49% 0% 0% 51%
Dart #2 Timed Out5 min648
Erlang HiPE Timed Out10 min622
Java  #6 Failed1410
Lisp SBCL Timed Out10 min591
OCaml #4 Failed1050
OCaml #2 Failed615
OCaml Failed1502
OCaml #3 Failed1014
Racket #2 Bad Output536
Scala #3 Failed633
Scala #4 Failed723
"wrong" (different) algorithm / less comparable programs
1.1Erlang HiPE #7 8.212.96261,9921198
1.3Java  #3 8.603.34257,5362084
1.3Perl #7 4.733.41140,028567
1.9Perl #6 4.974.98188,520477
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

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