The Computer Language
24.06 Benchmarks Game

regex-redux

(See rebar.)

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.56 212,180 662    
  Julia 3.90 491,688 414    
  Node.js #4 5.57 965,848 471    
  Ruby yjit #9 30.14 216,448 340    
 
 
 
× source secs mem gz cpu secs cpu load
1.0 C gcc #5 0.81 152,392 1403 2.03 55% 100% 46% 52%
1.2 C gcc #4 0.95 152,248 1237 3.27 75% 88% 100% 82%
1.5 C++ g++ #6 1.18 276,148 2856 2.23 30% 31% 100% 30%
1.5 Rust #6 1.19 153,464 994 1.44 8% 9% 26% 80%
1.6 Rust #5 1.30 202,600 777 1.54 0% 0% 82% 37%
1.6 Rust 1.31 153,796 811 1.57 6% 97% 8% 9%
1.6 Rust #3 1.33 202,916 726 1.59 26% 80% 7% 6%
1.7 Rust #4 1.34 199,556 771 1.59 19% 20% 80% 0%
1.7 Rust #2 1.37 153,780 707 1.61 81% 25% 6% 6%
2.1 C gcc #3 1.73 103,680 1273 3.31 99% 27% 28% 37%
2.3 PHP 1.86 194,852 822 3.67 34% 40% 40% 82%
2.3 F# .NET #6 1.86 860,664 622 5.47 67% 65% 66% 96%
2.6 C# .NET #5 2.11 860,544 679 6.32 80% 79% 67% 74%
3.5 C++ g++ #2 2.86 212,648 706 3.62 83% 43% 0% 0%
4.0 C gcc #2 3.21 103,296 1121 3.21 0% 0% 1% 100%
4.0 Go #5 3.22 320,724 817 5.39 33% 23% 21% 91%
4.4 C++ g++ 3.56 212,180 662 3.56 0% 100% 0% 0%
4.7 C++ g++ #5 3.81 215,648 859 4.53 99% 6% 6% 7%
4.8 Chapel #3 3.86 552,600 503 4.79 98% 9% 8% 8%
4.8 Julia 3.90 491,688 414 4.09 6% 96% 3% 0%
5.4 Node.js #3 4.33 798,716 675 5.35 90% 1% 1% 33%
5.7 C# .NET 4.60 847,380 641 4.84 29% 72% 0% 5%
5.7 Chapel #2 4.61 552,604 498 5.55 99% 7% 8% 7%
5.7 F# .NET #7 4.63 1,398,348 610 6.51 14% 29% 15% 84%
5.7 F# .NET #2 4.64 852,224 437 4.89 0% 72% 26% 8%
6.5 Java  #3 5.25 629,428 935 17.37 87% 79% 80% 86%
6.8 Free Pascal 5.52 103,016 1313 5.52 100% 0% 0% 0%
6.9 Node.js #4 5.57 965,848 471 5.71 91% 1% 1% 9%
6.9 Java #6 5.59 1,235,356 746 17.14 69% 88% 78% 71%
8.1 Ada 2012 GNAT #5 6.56 155,588 3647 17.00 82% 66% 60% 53%
10 Java 8.47 662,708 875 16.79 42% 44% 80% 32%
11 Python 3 8.84 432,748 515 16.23 51% 26% 74% 32%
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%
13 Dart #5 10.86 520,748 710 16.65 77% 43% 12% 20%
13 Dart #3 10.89 572,292 1061 19.28 24% 99% 24% 29%
15 Ruby yjit #3 11.90 216,576 730 24.25 42% 40% 87% 33%
15 C++ g++ #3 12.46 215,472 859 18.08 0% 5% 95% 45%
16 C# .NET #4 13.15 960,820 854 44.64 93% 95% 69% 83%
17 Lisp SBCL #4 13.96 931,948 1977 30.40 61% 42% 69% 45%
18 Racket #2 14.57 1,581,852 736 25.99 33% 37% 86% 22%
18 Go #4 14.78 397,240 832 36.01 50% 64% 55% 74%
20 Dart #4 16.29 471,832 513 16.37 1% 0% 0% 99%
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%
23 Dart #2 18.68 508,768 667 19.13 0% 0% 99% 1%
26 Swift #4 20.99 1,055,220 751 44.94 41% 44% 91% 37%
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%
29 Ruby yjit #2 23.24 216,448 444 23.26 25% 5% 46% 23%
30 Racket 23.98 1,296,464 548 23.97 0% 100% 0% 0%
30 Swift 24.44 889,924 721 43.38 77% 0% 0% 99%
32 Go #3 25.54 370,524 836 61.42 72% 59% 54% 54%
32 Go 25.87 311,444 749 64.23 61% 74% 48% 64%
37 Ruby yjit #9 30.14 216,448 340 30.13 0% 100% 0% 0%
43 Matz's Ruby #2 34.55 230,016 444 34.55 100% 0% 0% 0%
51 Matz's Ruby #9 41.08 230,016 340 41.07 100% 0% 0% 0%
53 Swift #2 42.42 684,644 678 42.42 100% 0% 0% 0%
Ada 2012 GNAT #6 Bad Output
C++ g++ #4 Make Error
F# .NET Bad Output
F# .NET #4 Bad Output
Lua Failed
Perl #5 Bad Output
 
 
  hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs cpu load
1.0 Rust #7 0.78 150,528 2464 2.00 62% 54% 52% 89%
1.2 Classic Fortran 0.95 180,044 2229 3.12 76% 78% 96% 81%
1.4 Haskell GHC #3 1.12 407,040 2219 2.34 35% 74% 61% 41%
1.7 Python 3 #2 1.35 168,036 1411 2.63 85% 34% 44% 31%
1.8 C# .NET #8 1.43 389,120 1881 2.67 36% 29% 84% 39%
2.2 Julia #5 1.77 446,632 766 3.10 4% 98% 72% 0%
2.3 Julia #4 1.83 451,444 772 3.17 100% 0% 4% 68%
2.8 Julia #3 2.27 485,636 630 3.79 12% 63% 92% 0%
3.3 OCaml #3 2.65 424,512 653 4.53 0% 70% 0% 100%
17 OCaml #2 13.57 922,756 644 13.57 100% 0% 0% 0%