The Computer Language
22.05 Benchmarks Game

regex-redux

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

First a few simple programs.

Then optimisations, multicore parallelism, [pdf] vector parallelism.

Last hand-written vector instructions and "unsafe" programs and the more obvious foreign function interface programs.

  source secs mem gz    
  C++ g++ 3.57 207,788 656    
  Julia 3.62 380,060 408    
  Node js #4 6.05 985,940 463    
  Ruby #9 25.88 678,228 321    
 
 
 
× source secs mem gz cpu cpu load
1.0 C gcc #5 0.79 152,220 1397 2.02 48% 100% 53% 54%
1.2 C gcc #4 0.94 152,056 1230 3.24 77% 86% 83% 100%
1.4 C++ g++ #4 1.09 203,888 1315 3.39 64% 100% 78% 72%
1.4 C++ g++ #6 1.09 275,924 2850 2.20 35% 33% 86% 50%
1.7 Rust #6 1.35 153,148 986 1.79 13% 28% 10% 82%
1.8 Rust #5 1.40 202,556 771 1.83 0% 48% 1% 83%
1.8 Rust #4 1.44 202,612 765 1.87 18% 81% 30% 1%
1.8 Rust #3 1.45 203,408 719 1.89 12% 10% 12% 99%
1.8 Rust 1.46 152,864 804 1.83 12% 87% 9% 25%
1.9 Rust #2 1.50 152,172 701 1.89 100% 9% 8% 9%
2.2 C gcc #3 1.73 103,540 1266 3.31 38% 27% 99% 28%
2.3 PHP 1.82 178,712 816 3.66 81% 36% 41% 43%
3.3 Lua 2.59 327,952 482 2.59 0% 0% 1% 100%
3.5 F# .NET #6 2.78 1,061,172 611 7.26 68% 60% 52% 84%
3.7 C++ g++ #2 2.92 198,316 700 3.69 1% 100% 1% 28%
3.7 C# .NET #5 2.92 1,061,452 673 7.45 55% 54% 68% 77%
4.1 C gcc #2 3.23 103,084 1115 3.23 100% 1% 0% 0%
4.5 C++ g++ 3.57 207,788 656 3.57 100% 0% 0% 0%
4.5 C++ g++ #5 3.57 214,888 852 4.28 7% 7% 18% 88%
4.6 Julia 3.62 380,060 408 3.88 3% 99% 3% 3%
4.6 Chapel #3 3.68 502,984 492 4.60 98% 9% 9% 10%
4.9 Go #5 3.85 306,476 810 5.97 20% 55% 54% 27%
5.0 F# .NET #7 3.95 1,219,132 599 5.82 28% 31% 34% 55%
5.4 Ada 2012 GNAT #5 4.27 154,816 3640 12.23 69% 91% 67% 60%
5.8 Chapel #2 4.61 502,264 489 5.52 99% 8% 7% 7%
6.2 Node js #3 4.89 1,045,556 668 5.97 3% 91% 27% 1%
6.9 Java  #3 5.47 741,028 929 17.34 74% 76% 92% 76%
6.9 Java #6 5.51 728,332 740 17.16 74% 83% 75% 79%
7.6 Node js #4 6.05 985,940 463 6.24 40% 60% 3% 3%
11 Java 8.76 924,116 868 17.12 35% 85% 36% 40%
12 Python 3 9.49 458,264 512 17.86 46% 35% 28% 81%
12 Perl #4 9.80 157,228 820 29.95 65% 96% 51% 95%
13 Perl #3 9.94 157,276 854 29.80 50% 95% 65% 90%
13 Dart #3 10.45 522,196 1055 18.31 25% 29% 82% 40%
14 Dart #5 10.92 491,284 706 16.41 39% 30% 31% 53%
15 Racket #2 12.22 2,003,760 729 22.58 39% 46% 3% 99%
16 Ruby #3 12.35 649,832 724 23.22 28% 33% 31% 96%
16 C++ g++ #3 12.58 217,248 853 18.28 100% 45% 2% 0%
18 Go #4 14.48 355,844 829 34.99 66% 57% 62% 56%
18 Lisp SBCL #4 14.52 1,074,864 1972 29.92 36% 46% 46% 79%
20 Matz's Ruby #3 15.83 223,648 724 36.10 94% 44% 44% 46%
21 Dart #4 16.34 465,960 511 16.37 99% 1% 1% 0%
21 Perl #2 16.52 204,960 710 28.74 0% 0% 100% 74%
23 Dart #2 18.19 491,456 663 18.54 99% 2% 1% 2%
28 Racket 21.85 2,074,452 541 21.84 100% 0% 1% 0%
28 Perl 21.87 205,584 464 21.87 0% 0% 100% 0%
28 Swift #4 22.06 1,061,888 745 45.38 44% 35% 35% 92%
29 Ruby #2 23.22 684,764 437 23.23 21% 16% 15% 49%
30 Swift 23.81 879,156 715 44.12 86% 0% 100% 0%
33 Ruby #9 25.88 678,228 321 25.87 100% 0% 0% 0%
35 Go #3 27.87 358,472 829 67.28 63% 47% 47% 86%
36 Go 28.32 297,048 741 68.45 49% 100% 47% 49%
43 Matz's Ruby #2 34.46 223,516 437 34.45 0% 100% 0% 0%
48 Erlang #6 38.47 3,651,976 1048 56.86 26% 35% 69% 18%
53 Matz's Ruby #9 41.76 223,480 334 41.74 1% 0% 0% 100%
55 Swift #2 43.47 682,836 671 43.47 0% 0% 0% 100%
Ada 2012 GNAT #6 Bad Output
Free Pascal #2 Failed
Free Pascal Failed
Perl #5 Bad Output
 
 
  hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu cpu load
1.0 Rust #7 0.78 147,360 2458 1.99 53% 53% 62% 90%
1.2 Classic Fortran 0.99 175,968 2225 3.07 73% 72% 67% 100%
1.3 Haskell GHC #3 1.03 403,240 2213 2.25 64% 40% 73% 42%
1.8 Python 3 #2 1.39 111,680 1403 2.66 87% 43% 32% 31%
1.8 C# .NET #8 1.42 319,484 1869 2.65 49% 30% 20% 89%
2.2 Julia #5 1.74 403,608 759 3.12 99% 69% 6% 6%
2.3 Julia #4 1.80 410,768 766 3.19 7% 5% 99% 68%
2.5 Julia #3 1.99 502,440 622 3.68 5% 76% 99% 5%
3.1 OCaml #3 2.43 525,884 647 4.18 0% 100% 1% 72%
18 OCaml #2 14.16 865,972 637 14.16 0% 0% 100% 0%