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.0Hack #4 6.132.45209,788832  71% 51% 57% 75%
1.0C gcc 5.812.45314,2002579  71% 52% 45% 71%
1.4Hack 3.353.38273,120787  63% 23% 48% 38%
1.5C++ g++ #2 5.373.64183,796695  35% 65% 3% 48%
1.8C++ g++ #4 13.344.4799,5961759  90% 52% 85% 74%
2.1C++ g++ 5.245.25207,788648  1% 1% 100% 0%
2.1Hack #3 5.265.26263,304456  100% 1% 1% 0%
2.1Hack #2 5.265.27259,076446  6% 0% 1% 100%
2.2Ada 2005 GNAT #5 16.485.49126,2083492  64% 93% 77% 67%
3.0Ada 2005 GNAT #6 22.657.47100,7403740  97% 65% 69% 73%
3.1C gcc #4 22.637.5289,7041525  71% 70% 96% 65%
3.3Scala #5 27.877.98466,0241704  85% 84% 92% 88%
3.4Java  #5 24.708.24761,724929  68% 73% 77% 83%
3.5Clojure #4 27.168.59606,564707  69% 92% 75% 81%
3.7Scala #2 24.858.96676,292668  82% 78% 58% 61%
3.8OCaml #4 1.399.43268,4801050  83% 83% 83% 100%
3.9Ruby #8 27.989.46106,548529  64% 68% 92% 72%
3.9PHP #4 27.699.58150,456832  64% 60% 67% 100%
3.9Erlang HiPE #6 34.609.60434,1721058  90% 92% 91% 88%
4.0Perl #2 27.169.70142,492527  76% 75% 77% 54%
4.1Erlang #6 35.029.95395,4681058  90% 90% 88% 85%
4.2Python 3 22.8910.29259,568478  71% 38% 39% 75%
4.3Ruby #3 30.9210.51397,644501  70% 65% 66% 95%
4.3OCaml #3 19.1510.65516,9761014  27% 28% 87% 39%
4.4PHP 12.5210.77232,020788  55% 55% 55% 91%
4.4OCaml 19.5710.85517,3561502  29% 27% 29% 98%
4.4Ruby #7 31.4910.89215,924507  66% 76% 63% 86%
4.5Haskell GHC #2 42.1711.06257,1081518  93% 96% 96% 96%
5.2Java  #2 40.2812.75781,6761534  90% 71% 82% 74%
6.8Ruby JRuby #7 49.5816.58787,976507  69% 67% 81% 84%
6.8Go #2 48.4916.64549,688789  64% 64% 95% 69%
6.9C++ g++ #3 25.7316.88184,628844  53% 1% 0% 100%
7.7OCaml #2 18.9418.95517,492615  1% 0% 100% 0%
8.2Java  #7 20.3319.99574,8921284  17% 1% 84% 1%
8.2Java  #8 20.5220.15574,7801377  1% 1% 1% 100%
8.4Lisp SBCL #3 43.9220.57643,3481948  41% 91% 42% 42%
8.4Java  #4 21.9220.59712,228921  16% 10% 79% 2%
8.6Ruby JRuby #3 56.6421.101,993,204501  64% 70% 68% 68%
9.0Rust 69.6422.01211,324740  100% 73% 72% 73%
9.3Ruby JRuby #2 65.1822.681,961,188417  58% 65% 79% 87%
9.6Python 3 #5 23.4523.46326,832424  99% 1% 1% 1%
9.8C# Mono #7 82.1423.90460,308898  87% 90% 85% 82%
10Ruby #6 24.4224.43144,896442  1% 0% 100% 1%
10Clojure #3 51.9425.59579,784710  61% 43% 49% 50%
11Go #8 86.7826.32513,712785  77% 100% 77% 77%
11PHP #3 27.3327.34229,012459  1% 1% 1% 100%
11C# Mono #6 76.4427.45369,244638  66% 63% 79% 73%
11C# Mono #2 81.0727.82361,404594  68% 62% 85% 77%
11Ruby #5 28.0228.03106,492343  0% 1% 1% 100%
12Ruby #2 28.1828.19434,096417  38% 8% 16% 40%
12C gcc #2 29.2129.22126,7001099  0% 100% 1% 0%
12Scala 33.6529.52872,224611  87% 6% 9% 12%
13Dart #2 32.5831.67350,480648  4% 99% 1% 1%
14Perl #4 34.9834.99142,320440  1% 0% 100% 0%
15Ruby JRuby #5 42.4936.35997,324343  24% 20% 68% 10%
15PHP #2 37.6337.65210,944449  1% 1% 1% 100%
16Racket 39.8539.85731,168527  1% 59% 1% 42%
17Ruby 40.5240.54371,580308  0% 1% 1% 100%
17Ruby JRuby #6 48.7942.411,023,248442  38% 7% 20% 52%
20Go 151.8448.96579,096733  92% 73% 75% 71%
32Ruby JRuby 89.1878.982,182,572308  9% 91% 7% 8%
34C# Mono 82.8482.86575,184624  0% 2% 94% 4%
35Go #7 87.1986.35467,180652  1% 54% 26% 22%
Erlang Timed Out10 min622
Erlang HiPE Timed Out10 min622
F# Mono Failed639
F# Mono #4 Failed899
F# Mono #2 Failed413
F# Mono #3 Failed870
Java  #6 Failed1410
Lisp SBCL Bad Output591
Racket #2 Bad Output536
Ruby JRuby #8 Failed529
Scala #4 Failed723
Scala #3 Failed633
"wrong" (different) algorithm / less comparable programs
1.1Perl #7 4.192.77141,684567
1.2Java  #3 7.882.87275,1642084
1.2Erlang HiPE #7 7.833.05398,5401198
1.6Erlang #7 8.443.91356,2281198
1.7Perl #6 4.144.15193,172477
8.6Pascal Free Pascal 20.9720.99114,8521199
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