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.0Rust #2 3.001.82186,948669  64% 59% 23% 23%
1.4C gcc 5.812.45314,2002579  71% 52% 45% 71%
1.4Hack #4 6.042.61202,280832  76% 54% 38% 68%
2.0C++ g++ #2 5.373.64183,796695  35% 65% 3% 48%
2.0Hack 3.603.66267,456787  36% 78% 26% 25%
2.5C++ g++ #4 13.344.4799,5961759  90% 52% 85% 74%
2.9C++ g++ 5.245.25207,788648  1% 1% 100% 0%
3.0Ada 2005 GNAT #5 16.485.49126,2083492  64% 93% 77% 67%
3.1Hack #3 5.585.59268,768456  1% 43% 54% 5%
3.1Hack #2 5.605.60273,108446  100% 1% 1% 1%
4.1Ada 2005 GNAT #6 22.657.47100,7403740  97% 65% 69% 73%
4.1C gcc #4 22.637.5289,7041525  71% 70% 96% 65%
4.4Scala #5 27.877.98466,0241704  85% 84% 92% 88%
4.5Java  #5 24.708.24761,724929  68% 73% 77% 83%
4.9Clojure #4 29.348.84607,884707  94% 81% 80% 78%
4.9Scala #2 24.858.96676,292668  82% 78% 58% 61%
5.2OCaml #4 1.399.43268,4801050  83% 83% 83% 100%
5.2Ruby #8 27.989.46106,548529  64% 68% 92% 72%
5.3PHP #4 27.699.58150,456832  64% 60% 67% 100%
5.3Perl #2 27.169.70142,492527  76% 75% 77% 54%
5.6Erlang #6 35.7410.16441,0361058  80% 93% 95% 85%
5.7Python 3 22.8910.29259,568478  71% 38% 39% 75%
5.7Erlang HiPE #6 35.9110.42383,6441058  88% 82% 90% 85%
5.8Ruby #3 30.9210.51397,644501  70% 65% 66% 95%
5.9OCaml #3 19.1510.65516,9761014  27% 28% 87% 39%
5.9PHP 12.5210.77232,020788  55% 55% 55% 91%
6.0OCaml 19.5710.85517,3561502  29% 27% 29% 98%
6.0Ruby #7 31.4910.89215,924507  66% 76% 63% 86%
6.1Haskell GHC #2 42.1711.06257,1081518  93% 96% 96% 96%
7.0Java  #2 40.2812.75781,6761534  90% 71% 82% 74%
9.1Ruby JRuby #7 49.5816.58787,976507  69% 67% 81% 84%
9.3C++ g++ #3 25.7316.88184,628844  53% 1% 0% 100%
9.3Go #2 49.0516.97474,400789  68% 72% 76% 74%
10OCaml #2 18.9418.95517,492615  1% 0% 100% 0%
11Java  #7 20.3319.99574,8921284  17% 1% 84% 1%
11Java  #8 20.5220.15574,7801377  1% 1% 1% 100%
11Java  #4 21.9220.59712,228921  16% 10% 79% 2%
12Lisp SBCL #3 45.2320.98653,1881948  43% 91% 40% 43%
12Ruby JRuby #3 56.6421.101,993,204501  64% 70% 68% 68%
12Ruby JRuby #2 65.1822.681,961,188417  58% 65% 79% 87%
13Python 3 #5 23.4523.46326,832424  99% 1% 1% 1%
13Ruby #6 24.4224.43144,896442  1% 0% 100% 1%
15Go #8 87.2526.66641,832785  93% 76% 77% 83%
15C# Mono #2 78.5027.05364,456594  80% 84% 62% 66%
15C# Mono #7 80.5727.26451,416898  87% 68% 78% 64%
15PHP #3 27.3327.34229,012459  1% 1% 1% 100%
15Ruby #5 28.0228.03106,492343  0% 1% 1% 100%
16Ruby #2 28.1828.19434,096417  38% 8% 16% 40%
16C gcc #2 29.2129.22126,7001099  0% 100% 1% 0%
16Scala 33.6529.52872,224611  87% 6% 9% 12%
17F# Mono #3 84.0130.542,021,328870  67% 65% 74% 71%
17F# Mono #4 89.7931.41934,324899  81% 63% 72% 72%
17F# Mono 84.2731.45791,372639  88% 61% 62% 61%
17C# Mono #6 77.6831.71367,296638  83% 59% 55% 49%
18Dart #2 33.5432.57332,740648  4% 89% 10% 1%
19Perl #4 34.9834.99142,320440  1% 0% 100% 0%
20Ruby JRuby #5 42.4936.35997,324343  24% 20% 68% 10%
21PHP #2 37.6337.65210,944449  1% 1% 1% 100%
22Ruby 40.5240.54371,580308  0% 1% 1% 100%
23Racket 40.9840.97739,896527  8% 19% 0% 75%
23Go 126.5041.62581,808733  74% 71% 82% 78%
23Ruby JRuby #6 48.7942.411,023,248442  38% 7% 20% 52%
44Ruby JRuby 89.1878.982,182,572308  9% 91% 7% 8%
44F# Mono #2 79.1279.13678,444413  0% 100% 1% 0%
45C# Mono 82.0582.06545,648624  0% 1% 1% 100%
48Go #7 86.8286.37361,056652  3% 3% 3% 92%
Clojure #3 Failed710
Erlang Timed Out15 min622
Erlang HiPE Timed Out15 min622
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.5Perl #7 4.192.77141,684567
1.6Java  #3 7.882.87275,1642084
1.6Erlang HiPE #7 7.882.97383,9641198
2.1Erlang #7 8.663.87383,7401198
2.3Perl #6 4.144.15193,172477
12Pascal 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