The Computer Language
24.09 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.97 696,664 828    
  Dart jit #5 5.15 2,144,340 942    
  Perl #3 6.77 1,495,228 295    
 
 
 
× source secs mem gz cpu secs cpu load
1.0 C gcc #8 0.49 499,868 1551 0.81 24% 22% 22% 100%
2.0 Chapel #8 0.96 1,057,024 1260 2.77 93% 64% 64% 70%
2.0 C gcc #6 0.97 696,664 828 1.39 25% 100% 17% 1%
2.0 Rust #2 0.98 995,200 1332 1.62 66% 21% 56% 23%
2.0 Rust #3 0.98 995,200 1105 1.68 42% 23% 58% 46%
2.2 C gcc #2 1.05 994,560 757 1.57 96% 22% 18% 14%
3.1 C gcc #5 1.52 994,176 654 1.52 0% 0% 1% 100%
3.2 C# .NET #7 1.56 941,012 1312 4.23 54% 95% 90% 33%
3.3 Julia #8 1.63 1,043,456 531 1.76 1% 8% 0% 99%
3.4 C# .NET #6 1.64 1,027,256 1627 3.95 70% 92% 57% 22%
3.7 Chapel #5 1.82 1,905,152 554 3.16 93% 25% 25% 31%
3.8 Chapel #3 1.84 2,121,344 709 3.24 92% 26% 26% 33%
3.8 Julia #9 1.87 1,041,788 456 2.00 0% 0% 92% 14%
3.9 Go #6 1.91 1,244,508 1340 3.40 72% 17% 31% 59%
4.5 Go #2 2.19 800,640 614 2.29 0% 16% 0% 89%
4.7 OCaml #3 2.28 19,676 1361 5.77 65% 65% 58% 63%
5.1 Go #3 2.48 800,384 609 2.57 94% 3% 1% 5%
5.4 C# .NET #5 2.64 1,026,620 1620 3.67 11% 20% 13% 96%
6.1 C# .NET 2.97 798,004 1130 3.15 86% 2% 15% 4%
6.2 Ada 2012 GNAT #2 3.02 822,344 3285 3.86 43% 85% 1% 0%
6.7 C++ g++ #6 3.26 1,517,580 1827 4.32 71% 30% 20% 12%
7.0 Java  #6 3.40 2,031,576 760 4.06 38% 80% 0% 1%
7.8 Free Pascal #2 3.81 525,052 773 3.81 0% 0% 0% 100%
8.2 Python 3 #5 4.03 1,500,508 960 7.30 0% 89% 38% 54%
8.6 Classic Fortran 4.22 986,300 1026 4.22 100% 1% 0% 0%
9.8 Java #5 4.78 1,096,264 1115 4.92 7% 62% 1% 34%
9.9 Python 3 #3 4.82 508,760 803 4.82 0% 100% 0% 0%
11 Lisp SBCL 5.46 1,494,784 911 5.46 100% 0% 0% 0%
11 Java #4 5.59 1,890,020 656 5.71 1% 56% 4% 40%
12 Perl #4 5.76 998,608 268 5.76 100% 0% 0% 0%
12 Ruby yjit #4 5.88 2,510,920 608 11.51 32% 86% 25% 53%
13 C++ g++ 6.50 979,912 599 6.50 0% 100% 0% 0%
14 Perl #3 6.77 1,495,228 295 6.76 1% 1% 99% 0%
15 C# .NET #3 7.31 1,571,904 934 11.48 29% 43% 66% 19%
16 Python 3 #6 7.71 2,484,208 821 11.18 27% 71% 44% 3%
16 PHP #3 7.75 536,668 452 12.24 30% 1% 55% 70%
18 Dart #5 8.92 1,994,504 942 12.05 8% 30% 68% 27%
18 Ruby yjit #3 8.95 4,235,052 490 17.34 97% 23% 25% 48%
19 OCaml #2 9.27 909,056 426 9.27 0% 99% 0% 0%
19 Matz's Ruby #3 9.49 3,467,256 490 17.96 76% 50% 33% 30%
20 PHP 9.89 1,489,328 323 9.89 0% 0% 99% 0%
21 Python 3 #2 10.13 1,788,624 440 10.12 100% 0% 0% 0%
21 Python 3 10.36 1,986,924 484 10.36 100% 0% 0% 0%
24 PHP #2 11.75 1,787,280 288 11.75 0% 0% 100% 0%
28 Python 3 #4 13.85 4,003,072 343 13.85 99% 0% 0% 0%
29 Ada 2012 GNAT 13.94 528,492 943 13.94 0% 0% 0% 100%
29 Ruby yjit #5 14.12 1,623,336 301 14.11 0% 100% 0% 0%
37 Ruby yjit 18.31 5,141,976 521 35.91 40% 94% 56% 4%
39 Dart 19.03 1,000,708 651 20.03 79% 1% 21% 2%
48 Java #7 23.61 1,036,152 1654 6.24 5% 11% 5% 4%
48 Matz's Ruby #2 23.61 688,216 272 23.61 58% 41% 0% 0%
56 Ruby yjit #2 27.45 1,001,920 272 27.45 0% 100% 0% 0%
73 Julia #2 35.75 1,911,596 464 36.47 0% 1% 100% 0%
74 C++ g++ #5 36.24 771,432 704 36.24 0% 0% 100% 0%
75 F# .NET 36.47 1,960,916 603 37.87 1% 1% 99% 1%
83 Racket 40.68 2,047,232 560 40.68 0% 100% 0% 0%
84 Lua #2 41.12 2,654,652 560 41.10 0% 100% 0% 0%
86 Lua #5 41.96 2,169,636 758 41.96 100% 0% 0% 0%
87 Classic Fortran #2 42.39 769,748 778 42.38 100% 0% 0% 0%
101 Lua #4 49.35 1,030,016 600 49.33 0% 100% 0% 0%
119 Dart #3 58.28 6,383,448 571 64.64 89% 3% 7% 10%
186 Dart #2 91.05 6,351,280 575 99.25 77% 17% 10% 4%
  Erlang 26 min 2,180,832 1309 30 min 41% 21% 15% 35%
C++ g++ #3 Bad Output
Dart #4 Bad Output
Erlang #4 Timed Out
Erlang #3 Timed Out
F# .NET #4 Timed Out
F# .NET #5 Timed Out
Go #5 Bad Output
Go Failed
Java #3 Bad Output
Java #8 Bad Output
Node.js #7 Bad Output
Lisp SBCL #2 Failed
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 secs cpu load
0.9 C gcc #7 0.43 499,928 1899 0.59 55% 14% 11% 56%
1.1 Rust 0.53 498,816 2762 0.83 19% 20% 18% 100%
1.1 C# .NET #8 0.56 736,084 2641 1.35 87% 78% 7% 71%
1.5 C++ g++ #2 0.71 499,712 2099 0.71 59% 1% 0% 41%
4.0 Swift 1.95 798,228 1293 2.39 40% 4% 1% 78%
4.6 OCaml 2.25 19,676 1372 5.09 57% 59% 56% 53%
6.3 Haskell GHC #4 3.08 507,008 1047 3.15 2% 55% 20% 25%
7.5 C gcc #4 3.68 500,480 716 3.68 0% 1% 100% 0%
13 Haskell GHC #2 6.37 3,533,056 998 6.48 0% 35% 53% 12%
19 Racket #2 9.06 784,116 1038 9.06 0% 100% 0% 0%
32 Node.js #2 15.71 728,180 1228 16.37 2% 4% 35% 64%