The Computer Language
22.05 Benchmarks Game

reverse-complement

First a few simple programs.

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

Last hand-written vector instructions and "unsafe" programs.

  source secs mem gz    
  C gcc #6 0.88 688,416 820    
  Dart JIT #5 5.46 2,102,068 933    
  Perl #3 6.48 1,495,156 287    
 
 
 
× source secs mem gz cpu cpu load
1.0 C gcc #8 0.46 499,184 1627 0.77 98% 24% 22% 24%
1.7 Rust #2 0.78 995,032 1330 1.36 81% 25% 25% 46%
1.8 Rust #3 0.80 995,032 1097 1.52 32% 69% 30% 61%
1.9 C gcc #6 0.88 688,416 820 1.27 18% 99% 1% 27%
2.2 C gcc #2 0.99 994,152 750 1.45 87% 16% 15% 32%
2.9 Go #5 1.33 1,483,756 996 2.26 38% 22% 31% 81%
2.9 Go #6 1.34 1,289,572 1338 2.48 41% 51% 38% 56%
3.1 C gcc #5 1.42 994,088 647 1.42 1% 0% 1% 100%
3.1 Julia #8 1.44 683,748 522 1.71 13% 98% 6% 7%
3.4 Java  #8 1.53 665,804 2183 3.49 65% 62% 49% 53%
3.4 F# .NET #5 1.56 1,030,932 1140 4.29 55% 95% 31% 95%
3.5 C# .NET #6 1.59 1,029,352 1621 3.79 86% 78% 29% 46%
3.5 F# .NET #4 1.61 1,030,720 1139 4.43 92% 51% 94% 39%
3.7 Julia #9 1.68 681,000 449 1.95 5% 98% 6% 8%
3.7 Chapel #3 1.71 1,883,644 755 3.03 92% 26% 27% 33%
4.0 C# .NET #7 1.82 979,712 1310 5.13 60% 35% 94% 93%
4.2 Go #2 1.90 826,796 611 1.94 1% 1% 99% 2%
4.5 Ada 2012 GNAT #2 2.05 786,180 3283 2.37 0% 76% 40% 1%
4.6 Go #3 2.09 826,544 605 2.13 3% 14% 0% 87%
5.4 Chapel #2 2.45 1,053,240 983 3.44 97% 16% 23% 5%
5.4 Java #3 2.48 1,170,232 1722 5.09 48% 35% 36% 85%
5.7 C++ g++ #3 2.62 500,008 840 2.62 100% 0% 1% 0%
6.2 C# .NET #5 2.83 1,032,176 1613 4.02 10% 36% 6% 91%
6.5 C++ g++ #6 2.98 1,513,136 1832 4.00 66% 14% 32% 24%
7.8 Java #6 3.54 2,024,016 752 4.15 1% 0% 83% 34%
8.1 Free Pascal #2 3.70 514,916 771 3.70 0% 0% 100% 1%
8.8 Classic Fortran 4.02 985,592 1019 4.02 100% 0% 0% 0%
11 Java #5 4.84 1,088,392 1108 4.92 2% 93% 5% 4%
12 Java #4 5.36 1,881,900 651 5.41 4% 1% 96% 1%
12 Lisp SBCL 5.54 1,499,284 904 5.53 3% 1% 100% 0%
14 C++ g++ 6.34 979,988 592 6.34 1% 0% 0% 100%
14 Perl #3 6.48 1,495,156 287 6.47 0% 0% 100% 0%
15 PHP #3 7.02 528,172 446 11.26 6% 73% 32% 49%
16 Python 3 #6 7.22 1,005,184 814 10.64 29% 19% 47% 54%
18 Dart #5 8.15 2,001,632 933 11.25 75% 17% 15% 28%
21 Python 3 #2 9.38 1,786,488 434 9.38 0% 0% 0% 100%
21 Python 3 9.63 1,979,276 479 9.63 0% 0% 100% 0%
21 PHP 9.66 1,487,780 318 9.64 0% 0% 0% 100%
23 Ruby #4 10.37 2,273,936 601 22.60 47% 55% 41% 74%
23 Ruby #3 10.37 2,272,876 482 19.15 30% 48% 98% 12%
25 PHP #2 11.31 1,784,488 281 11.31 100% 1% 1% 0%
25 Ruby #5 11.49 1,874,980 295 11.49 0% 1% 100% 0%
27 Python 3 #4 12.31 4,001,684 335 12.31 1% 1% 100% 0%
27 Ada 2012 GNAT 12.47 515,456 937 12.46 0% 0% 100% 0%
38 Dart 17.26 1,008,688 642 18.36 99% 1% 2% 2%
40 Ruby 18.40 2,273,352 514 32.89 7% 48% 98% 27%
42 Ruby #2 19.41 774,468 264 19.40 0% 0% 100% 0%
46 Matz's Ruby #2 21.02 492,816 264 21.00 1% 0% 100% 0%
51 Java #7 23.16 1,030,892 1647 23.16 33% 16% 4% 38%
53 Erlang 24.33 3,129,524 1302 67.57 59% 75% 71% 73%
70 Julia #2 31.88 1,742,028 460 32.14 1% 100% 0% 0%
76 C++ g++ #5 34.88 765,148 720 34.88 100% 0% 0% 0%
84 Classic Fortran #2 38.55 752,488 772 38.53 0% 0% 0% 100%
87 Racket 39.70 2,575,076 553 39.70 0% 0% 100% 0%
91 Lua #2 41.55 2,654,764 553 41.55 100% 0% 0% 0%
99 Lua #5 45.45 2,163,180 719 45.44 1% 0% 0% 100%
117 Lua #4 53.35 1,030,160 594 53.35 100% 0% 0% 0%
118 Dart #3 53.83 6,467,208 563 56.61 4% 4% 95% 2%
182 Dart #4 83.32 1,037,088 880 91.27 3% 4% 100% 4%
202 Dart #2 92.39 6,468,920 568 95.63 2% 97% 2% 3%
215 Erlang #4 98.31 2,005,888 1171 132.35 19% 20% 19% 84%
343 Erlang #3 156.96 6,163,520 630 158.88 25% 6% 14% 63%
Go Failed
Lisp SBCL #2 Bad Output
OCaml #4 Make Error
OCaml #3 Make Error
OCaml #2 Make Error
Matz's Ruby #3 Bad Output
Matz's Ruby Failed
Matz's Ruby #5 Failed
Matz's Ruby #4 Failed
VW Smalltalk Bad Output
 
 
  hand-written vector instructions | "unsafe"
 
× source secs mem gz cpu cpu load
0.9 C gcc #7 0.40 499,132 1965 0.57 13% 15% 93% 21%
1.0 Rust 0.46 499,068 3040 0.76 100% 22% 22% 22%
1.2 C# .NET #8 0.55 930,564 2637 1.25 64% 81% 39% 50%
1.4 C++ g++ #2 0.64 499,708 2093 0.64 2% 0% 2% 100%
3.7 OCaml 1.70 34,432 1368 4.61 69% 66% 67% 70%
3.9 Swift 1.80 794,484 1286 2.26 75% 4% 48% 1%
5.7 Node js #7 2.59 1,556,168 1480 4.97 53% 38% 68% 31%
7.1 Haskell GHC #4 3.25 507,144 1041 3.51 1% 97% 1% 1%
7.6 C gcc #4 3.49 500,416 709 3.49 1% 0% 100% 2%
13 Haskell GHC #2 6.01 3,531,324 998 6.44 1% 45% 2% 55%
19 Racket #2 8.74 687,976 1030 8.74 0% 0% 100% 0%
35 Node js #2 16.20 727,572 1221 16.87 56% 25% 2% 22%