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.342.67290,7922579  96% 76% 84% 67%
1.5C++ g++ #2 5.574.02176,492695  2% 63% 75% 1%
1.9C++ g++ #4 15.285.0694,6321759  87% 51% 75% 90%
2.1C++ g++ 5.505.51182,988648  2% 1% 100% 2%
2.5Ada 2005 GNAT #5 19.526.55168,0043492  71% 67% 73% 87%
2.8Ada 2005 GNAT #6 22.457.42118,1643740  70% 72% 65% 97%
2.8C gcc #4 22.517.5088,0761525  70% 68% 100% 63%
3.1Scala #5 28.078.25451,9121704  92% 84% 83% 83%
3.3Java  #5 25.798.80729,244929  77% 80% 72% 66%
3.3Clojure #4 28.088.84797,168707  72% 72% 88% 86%
3.6Scala #2 26.119.64684,748668  80% 65% 59% 68%
3.7PHP #4 29.0210.00152,084832  64% 67% 65% 96%
3.9Haskell GHC #2 39.4410.41208,9641518  97% 97% 93% 93%
4.0Python 3 23.4910.58253,208478  47% 39% 94% 43%
4.0Perl #2 27.6210.63142,432527  77% 61% 80% 44%
4.1PHP 12.9410.94222,360788  55% 54% 55% 97%
4.2Erlang HiPE #6 39.8211.17283,5521058  93% 90% 89% 86%
4.6Ruby #3 36.1312.28348,464501  65% 78% 70% 82%
4.7Java  #2 40.0012.59725,0641534  72% 75% 97% 75%
4.8Ruby #8 36.3412.83115,624529  92% 60% 64% 69%
5.1Ruby #7 37.7213.73183,768507  62% 62% 95% 58%
6.2Go #2 48.3516.461,153,468789  65% 65% 78% 87%
7.4C++ g++ #3 31.7019.67180,580844  67% 0% 1% 94%
7.4Java  #8 20.0819.68567,3281377  5% 4% 7% 87%
7.5Java  #7 20.4620.05567,1401284  13% 1% 88% 1%
7.8Lisp SBCL #3 43.8220.93581,1641948  44% 41% 89% 37%
8.5Java  #4 24.3722.66735,240921  6% 10% 89% 4%
8.9Python 3 #5 23.8323.84247,660424  1% 4% 0% 97%
9.1Rust 76.2024.37213,116740  72% 99% 72% 71%
9.5Clojure #3 47.0825.34871,904710  64% 40% 44% 40%
9.8Go #8 85.9026.161,158,596785  77% 85% 75% 92%
9.8C# Mono #7 88.1726.23435,892898  86% 86% 83% 82%
10F# Mono 87.7827.89823,336639  78% 91% 71% 76%
11PHP #3 28.4828.49217,104459  0% 0% 1% 100%
11Ruby #6 28.6328.64144,172442  0% 0% 100% 1%
11C gcc #2 29.6229.64127,7521099  100% 1% 0% 0%
11C# Mono #2 85.5429.91356,044594  64% 64% 78% 81%
12F# Mono #3 89.7530.931,934,076870  72% 65% 86% 72%
12C# Mono #6 85.1430.96366,912638  61% 73% 66% 76%
12F# Mono #4 88.8331.65948,464899  65% 64% 93% 60%
12Scala 36.8032.42914,460611  12% 10% 63% 30%
13Perl #4 34.5534.57141,784440  1% 1% 1% 100%
13Ruby #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%
19Ruby 51.1051.12418,408308  0% 0% 100% 1%
19Go 162.8251.401,239,576733  94% 75% 73% 76%
28Dart #2 74.8273.61253,904648  1% 5% 1% 96%
32Go #7 86.7085.831,046,540652  12% 30% 60% 1%
33C# Mono 88.2688.29637,264624  34% 1% 12% 56%
34F# Mono #2 91.6491.67750,716413  45% 1% 1% 56%
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 #6 Failed442
Ruby JRuby #7 Bad Output507
Ruby JRuby #5 Failed343
Ruby JRuby #2 Bad Output417
Ruby JRuby Failed308
Ruby JRuby #8 Failed529
Ruby JRuby #3 Bad Output501
Scala #3 Failed633
Scala #4 Failed723
"wrong" (different) algorithm / less comparable programs
1.1Perl #7 4.242.88141,904567
1.2Java  #3 8.233.09267,9682084
1.2Erlang HiPE #7 7.893.22278,1201198
1.6Perl #6 4.284.29190,284477
8.1Pascal 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