The Computer Language
24.11 Benchmarks Game

regex-redux

These are crowd sourced programs, contributed to the project by an ever-changing self-selected group.

We include both un-optimised programs and heavily optimised programs (look at the gz source code size). We include both single-thread programs and multi-thread programs (look at the cpu secs and cpu load). We include [pdf] vector parallelism and even hand-written vector instructions.

 

(See rebar.)

Regex might be provided by wrapping a third-party library written in some-other programming language. How would you know?

Always look at the source code.

× source secs mem gz cpu secs cpu load
1.0 C gcc #5 0.81 152,500 1403 2.03 52% 100% 47% 55%
1.2 Intel Fortran 0.96 179,724 2229 3.09 78% 77% 75% 96%
1.2 C gcc #4 0.97 152,264 1237 3.28 80% 100% 72% 87%
1.4 C++ g++ #6 1.15 276,336 2856 2.24 92% 40% 33% 34%
1.5 Rust #6 1.17 153,780 994 1.42 7% 7% 7% 100%
1.6 Rust #5 1.33 202,800 777 1.57 37% 0% 0% 83%
1.7 Rust #4 1.34 199,684 771 1.58 0% 18% 81% 18%
1.7 Rust 1.34 153,972 811 1.56 82% 6% 23% 8%
1.7 Rust #3 1.34 202,952 726 1.59 26% 6% 6% 80%
1.7 C# .NET #2 1.36 402,516 1881 2.60 85% 33% 19% 57%
1.7 Rust #2 1.38 153,932 707 1.63 100% 5% 6% 8%
1.9 Java  #2 1.55 372,764 2201 3.16 38% 32% 37% 98%
2.1 C gcc #3 1.72 103,736 1273 3.31 83% 43% 28% 38%
2.2 C# .NET #5 1.74 614,536 679 5.02 72% 66% 74% 77%
2.2 F# .NET #6 1.77 767,564 622 5.11 74% 62% 88% 64%
2.3 PHP 1.87 194,684 822 3.70 46% 34% 43% 74%
3.8 Chapel #3 3.11 404,924 503 4.05 99% 11% 11% 10%
4.0 C gcc #2 3.21 103,288 1121 3.21 100% 0% 0% 0%
4.0 Go #5 3.25 321,360 817 5.43 31% 21% 23% 90%
4.4 Chapel #2 3.54 405,032 498 4.48 98% 9% 10% 9%
5.1 Julia 4.10 606,148 414 4.24 99% 2% 2% 1%
5.3 Node.js #3 4.27 796,080 675 5.30 1% 1% 32% 89%
5.7 F# .NET #7 4.58 662,224 610 6.41 19% 14% 14% 93%
5.7 C# .NET 4.60 599,212 641 4.83 38% 8% 59% 1%
5.8 F# .NET #2 4.72 850,784 437 4.97 70% 0% 2% 33%
6.5 Java #3 5.25 611,476 935 17.25 81% 84% 84% 80%
6.7 Node.js #4 5.41 978,952 471 5.56 99% 2% 1% 2%
6.8 Free Pascal 5.52 103,016 1313 5.52 100% 0% 0% 0%
6.9 Java #6 5.60 1,237,440 746 17.12 86% 66% 73% 80%
7.3 Ada 2012 GNAT #5 5.86 155,548 3647 16.14 78% 61% 78% 58%
10 Java 8.47 575,552 875 16.69 67% 46% 44% 40%
11 Dart #5 8.62 521,032 710 13.85 61% 47% 38% 15%
11 C# .NET #4 8.65 854,996 854 29.97 77% 94% 81% 94%
11 Python 3 8.91 432,220 515 16.44 80% 27% 43% 35%
12 Dart #3 9.96 563,160 1061 17.39 95% 22% 29% 27%
13 Perl #4 10.21 157,444 823 30.52 62% 92% 48% 95%
13 Perl #3 10.36 410,236 857 30.81 58% 52% 92% 95%
15 Ruby yjit #3 11.84 216,576 730 23.97 39% 95% 34% 33%
15 C++ g++ #3 12.38 215,640 859 17.95 30% 1% 45% 70%
17 Dart #4 13.48 472,972 513 13.62 65% 35% 1% 0%
17 Lisp SBCL #4 14.02 1,214,164 1977 29.73 47% 54% 45% 66%
17 Racket #2 14.03 1,552,444 736 25.37 46% 44% 36% 53%
18 Go #4 14.61 369,008 832 35.91 57% 54% 75% 60%
20 Matz's Ruby #3 16.32 230,016 730 36.32 46% 93% 41% 41%
21 Perl #2 17.06 205,440 717 29.44 86% 0% 85% 0%
21 Dart #2 17.14 515,328 667 17.70 40% 61% 0% 1%
23 Swift #4 18.30 1,064,768 751 41.36 41% 91% 53% 41%
27 Erlang #6 21.80 4,651,256 1055 41.89 59% 46% 54% 31%
28 Perl 22.28 205,748 471 22.28 100% 0% 0% 0%
28 Ruby yjit #2 22.86 216,576 444 22.87 47% 27% 5% 20%
29 Swift 23.40 891,792 721 39.65 69% 0% 0% 99%
30 Racket 24.06 1,294,636 548 24.06 0% 100% 0% 0%
31 Go 25.37 319,956 749 61.07 63% 62% 55% 60%
32 Go #3 25.62 371,204 836 61.79 74% 72% 47% 47%
37 Ruby yjit #9 29.92 216,704 340 29.91 0% 100% 0% 0%
43 Matz's Ruby #2 34.55 230,016 444 34.55 100% 0% 0% 0%
48 Swift #2 38.80 686,136 678 38.80 100% 0% 0% 0%
51 Matz's Ruby #9 41.08 230,016 340 41.07 100% 0% 0% 0%
Ada 2012 GNAT #6 Bad Output
C++ g++ Make Error
C++ g++ #2 Make Error
C++ g++ #5 Make Error
C++ g++ #4 Make Error
F# .NET Bad Output
F# .NET #4 Bad Output
Lua Failed
Perl #5 Bad Output
 
 
  * possible hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs cpu load
1.0 * Rust #7 0.78 148,924 2464 2.00 47% 55% 64% 89%
1.4 * Haskell GHC #3 1.10 414,592 2219 2.32 53% 39% 75% 44%
1.7 * Python 3 #2 1.35 168,236 1411 2.64 43% 31% 37% 87%
2.2 * Julia #5 1.80 431,004 766 3.12 5% 70% 99% 1%
2.3 * Julia #4 1.89 433,140 772 3.22 98% 2% 6% 64%
2.6 * Julia #3 2.07 578,576 630 3.51 7% 1% 71% 91%
2.7 * OCaml #3 2.20 451,620 653 3.35 0% 100% 1% 52%
17 * OCaml #2 13.99 922,636 644 13.99 0% 0% 0% 100%