The Computer Language
22.05 Benchmarks Game

binary-trees

First a few simple programs.

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

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

  source secs mem gz    
  Erlang 11.96 447,052 420    
  Pharo Smalltalk 32.54 327,168 669    
 
 
 
× source secs mem gz cpu cpu load
1.0 C++ g++ #7 0.97 168,192 890 3.38 97% 85% 85% 85%
1.1 Rust #5 1.02 198,536 765 3.60 85% 86% 85% 99%
1.2 C++ g++ #5 1.15 200,020 885 4.10 87% 86% 89% 97%
1.2 Rust #2 1.17 200,024 721 4.17 87% 100% 86% 86%
1.3 Rust #4 1.23 181,444 756 4.40 98% 86% 88% 88%
1.4 Rust #3 1.35 163,904 754 4.87 90% 99% 89% 88%
1.6 C gcc #2 1.55 168,384 809 4.32 56% 100% 68% 58%
1.6 C++ g++ #9 1.55 135,652 809 4.16 53% 100% 66% 52%
1.9 C gcc #3 1.82 134,068 836 4.71 49% 60% 100% 51%
1.9 C++ g++ #3 1.83 265,220 945 4.65 42% 77% 87% 48%
2.1 Free Pascal #7 2.05 132,372 968 4.98 56% 100% 40% 48%
2.2 Free Pascal #5 2.08 132,616 923 5.05 48% 100% 57% 41%
2.2 Free Pascal #6 2.08 132,368 936 4.67 47% 40% 100% 39%
2.2 C++ g++ #8 2.11 265,808 820 5.05 75% 37% 42% 88%
2.2 C++ g++ #6 2.13 265,784 844 4.72 35% 100% 41% 48%
2.2 Classic Fortran #2 2.15 136,860 1148 6.74 70% 81% 77% 88%
2.3 Rust 2.20 132,604 751 7.70 87% 88% 83% 94%
2.6 Java  #7 2.48 2,460,388 835 7.73 77% 73% 93% 71%
2.7 Lisp SBCL #3 2.59 673,772 932 6.77 60% 69% 79% 55%
2.7 C++ g++ 2.65 1,947,704 754 8.99 84% 84% 90% 83%
3.4 Ada 2012 GNAT #4 3.30 203,012 2107 10.20 76% 73% 93% 68%
4.0 OCaml #2 3.87 135,536 751 10.65 83% 69% 40% 84%
4.2 Haskell GHC #8 4.04 436,024 799 9.77 68% 66% 59% 53%
4.6 Java #3 4.48 2,106,820 540 5.19 7% 52% 11% 48%
4.7 Haskell GHC #7 4.59 549,592 811 11.30 51% 74% 58% 65%
4.9 C# .NET #7 4.69 1,609,712 694 15.29 80% 78% 89% 81%
4.9 Java #6 4.70 2,093,916 529 5.35 8% 46% 55% 6%
4.9 Java #4 4.74 2,079,388 840 5.44 33% 5% 71% 8%
4.9 Java #2 4.77 1,877,464 552 5.45 93% 9% 7% 6%
5.0 C# .NET #3 4.81 1,964,552 676 15.35 85% 79% 77% 80%
5.0 C# .NET #2 4.88 1,475,276 705 15.77 78% 82% 87% 78%
5.2 C# .NET 5.06 1,691,664 657 16.14 80% 85% 78% 78%
5.3 Erlang #2 5.14 448,724 478 15.97 72% 75% 78% 86%
5.7 Haskell GHC #6 5.53 454,300 592 11.52 50% 50% 65% 45%
6.1 F# .NET #7 5.85 1,398,648 516 15.62 68% 69% 70% 61%
7.3 Haskell GHC #3 7.06 683,828 538 16.02 54% 47% 49% 79%
7.7 Haskell GHC #5 7.39 681,832 561 15.65 59% 58% 51% 43%
8.3 Chapel #3 8.02 299,452 488 24.33 100% 58% 75% 74%
8.6 Node js #6 8.28 1,322,340 744 27.83 86% 89% 82% 80%
9.0 C gcc #5 8.69 351,304 908 32.02 93% 92% 98% 86%
9.1 OCaml #5 8.81 154,648 461 8.80 0% 0% 100% 0%
9.3 Racket #2 8.96 308,092 416 8.95 1% 0% 100% 0%
9.6 Lisp SBCL 9.23 654,568 589 9.23 100% 1% 0% 0%
12 Haskell GHC #2 11.45 440,892 491 13.54 6% 5% 6% 99%
12 Ada 2012 GNAT #3 11.82 528,532 1266 34.15 75% 69% 69% 71%
12 Node js 11.84 1,173,028 711 36.72 79% 78% 79% 79%
12 Erlang 11.96 447,052 420 12.14 1% 7% 87% 8%
13 Go #2 12.23 632,396 666 48.67 100% 100% 100% 100%
13 Dart #6 12.73 419,868 482 16.68 94% 17% 12% 13%
13 Go #5 12.77 394,800 950 50.52 99% 99% 99% 99%
13 Go #3 12.93 328,700 799 50.09 98% 96% 98% 97%
14 Dart #4 13.25 485,304 1387 30.02 58% 67% 54% 51%
14 Dart #7 13.38 493,372 863 30.02 53% 53% 55% 64%
14 Haskell GHC 13.44 683,156 494 15.26 4% 99% 5% 4%
14 Swift #3 13.49 700,092 862 43.45 82% 76% 65% 100%
14 Swift #2 13.50 699,876 816 44.09 79% 85% 65% 100%
14 Swift #5 13.84 733,388 806 41.37 73% 95% 62% 70%
14 Dart #5 13.89 479,012 1016 33.05 59% 63% 68% 58%
16 Racket 15.26 435,536 476 15.25 4% 100% 1% 0%
16 Julia #3 15.27 608,728 634 48.85 87% 73% 73% 88%
17 VW Smalltalk #3 16.71 375,908 930 38.72 53% 34% 86% 58%
17 Julia #4 16.87 495,284 372 47.16 80% 65% 70% 66%
18 PHP #7 17.81 1,589,184 760 64.15 89% 95% 88% 90%
19 Dart #3 17.89 863,324 1212 44.18 62% 65% 64% 57%
20 Julia #2 18.93 600,804 423 37.16 35% 97% 32% 33%
20 Swift #4 19.08 700,512 765 60.93 100% 79% 75% 67%
21 Swift 19.89 733,908 714 59.11 95% 72% 69% 62%
22 PHP #4 21.20 1,558,972 779 62.76 88% 84% 73% 52%
23 Ada 2012 GNAT 22.00 266,008 888 21.99 1% 0% 100% 1%
23 C gcc 22.18 263,664 654 22.16 0% 1% 0% 100%
23 C++ g++ #2 22.61 265,180 508 22.61 1% 100% 1% 1%
27 Ruby #5 26.46 671,376 1008 75.52 62% 62% 63% 98%
28 Julia #5 27.09 665,480 390 79.14 79% 65% 75% 74%
29 PHP #6 27.88 802,924 868 90.44 76% 86% 76% 87%
29 Go #7 27.89 259,088 525 51.41 47% 45% 51% 44%
29 Go 28.11 240,292 482 51.02 46% 44% 49% 44%
29 Go #6 28.40 411,424 611 29.23 2% 2% 1% 98%
34 Classic Fortran 32.50 525,944 773 32.50 100% 0% 0% 1%
35 PHP #5 33.46 803,212 1040 85.70 79% 87% 13% 79%
37 Node js #7 35.57 1,107,220 451 40.72 32% 35% 34% 17%
38 VW Smalltalk 36.87 375,616 711 36.82 0% 100% 0% 0%
49 Python 3 #5 47.80 273,284 660 172.44 90% 91% 89% 92%
50 Python 3 #4 48.11 456,220 472 176.37 90% 90% 90% 100%
52 Lua #4 49.93 927,464 664 182.34 92% 91% 93% 98%
52 Python 3 50.62 282,996 589 178.66 87% 94% 86% 88%
53 PHP #3 51.65 1,561,956 428 51.64 0% 1% 100% 0%
59 Perl #5 56.90 1,048,472 797 209.51 90% 100% 89% 90%
64 PHP #2 62.29 748,408 423 62.27 100% 0% 0% 0%
65 PHP 62.41 748,424 451 62.40 0% 1% 100% 1%
71 Ruby #4 68.26 667,224 364 68.23 0% 100% 0% 0%
74 Ruby 71.74 667,228 376 71.73 100% 0% 0% 0%
75 Ruby #3 72.07 896,992 400 72.06 1% 0% 100% 0%
75 Ruby #2 72.25 667,172 378 72.24 1% 1% 100% 0%
78 Perl #4 75.76 2,519,768 761 274.10 91% 97% 88% 88%
83 Python 3 #3 80.07 669,832 1238 230.73 62% 100% 63% 64%
86 Lua #3 83.49 927,544 684 167.23 51% 48% 50% 53%
119 Perl #3 114.85 2,200,608 648 6 min 95% 93% 80% 73%
150 Lua #2 144.58 963,568 412 144.57 1% 0% 1% 100%
153 Python 3 #2 148.10 270,872 338 148.09 100% 1% 0% 0%
261 Perl 252.40 599,520 395 252.39 100% 1% 0% 0%
328 Matz's Ruby #5 5 min 1,413,456 1008 16 min 73% 72% 75% 95%
588 Matz's Ruby #3 9 min 840,244 400 9 min 0% 3% 0% 97%
713 Matz's Ruby #4 11 min 1,560,732 364 11 min 15% 62% 2% 27%
  Matz's Ruby 12 min 1,559,732 376 12 min 0% 100% 0% 0%
  Matz's Ruby #2 12 min 1,558,884 378 12 min 49% 0% 51% 0%
C++ g++ #4 Make Error
Swift #9 Make Error
 
 
  hand-written vector instructions | "unsafe"
 
× source secs mem gz cpu cpu load
4.7 Racket #4 4.54 545,328 853 8.90 42% 47% 43% 67%
6.6 Racket #3 6.42 299,864 473 6.42 0% 1% 0% 100%