The Computer Language
Benchmarks Game

binary-trees

Always look at the source code.

Look at the slower simple sequential programs, and  look at the parallel programs written for multicore, and  look at the manually vectorized SIMD programs.

× source secs mem gz busy cpu load
1.0 C++ g++ #7 0.94 176,428 1122 3.39 86% 88% 100% 85%
1.1 Rust #5 1.08 198,580 765 3.81 85% 99% 86% 84%
1.2 C++ g++ #5 1.14 200,396 885 4.17 100% 89% 87% 89%
1.2 Rust #2 1.17 199,940 721 4.21 100% 87% 86% 86%
1.3 C++ g++ #4 1.25 134,416 1270 3.64 74% 61% 69% 88%
1.4 Rust #4 1.29 170,984 756 4.67 87% 88% 99% 88%
1.4 Rust #3 1.34 195,644 754 4.96 99% 90% 90% 89%
1.6 C++ g++ #9 1.51 125,080 809 4.21 100% 69% 56% 54%
1.6 C gcc #2 1.54 168,832 809 4.35 60% 67% 57% 100%
1.9 C gcc #3 1.79 119,812 836 4.82 53% 52% 99% 66%
1.9 C++ g++ #3 1.83 265,396 945 4.59 40% 58% 88% 64%
2.0 C++ g++ #6 1.84 265,756 844 4.55 49% 40% 88% 70%
2.1 Free Pascal #6 1.99 132,728 959 4.97 100% 58% 50% 42%
2.1 Free Pascal #7 2.01 132,732 1003 5.00 100% 58% 42% 49%
2.2 Free Pascal #5 2.03 132,728 953 4.72 99% 49% 43% 42%
2.2 C++ g++ #8 2.10 265,768 820 5.15 44% 48% 88% 66%
2.3 Rust 2.21 133,000 751 7.94 97% 86% 88% 88%
2.5 Intel Fortran #2 2.38 133,752 1148 7.45 100% 70% 70% 73%
2.6 Java  #7 2.48 1,722,848 835 7.88 98% 75% 71% 74%
2.8 C++ g++ 2.60 1,954,096 754 8.99 87% 83% 92% 84%
3.0 Lisp SBCL #3 2.84 529,972 932 7.09 73% 46% 63% 67%
3.3 Ada 2012 GNAT #4 3.12 202,368 2107 9.63 79% 93% 67% 71%
4.6 Racket #4 4.31 557,636 853 8.76 47% 48% 66% 42%
4.9 Java #6 4.61 2,069,824 529 5.44 6% 6% 15% 91%
4.9 Java #3 4.64 2,046,328 540 5.44 12% 91% 9% 6%
5.0 OCaml #2 4.68 152,716 751 13.23 78% 99% 42% 64%
5.0 Java #4 4.73 2,099,092 840 6.86 41% 31% 46% 26%
5.1 Java #2 4.77 2,061,836 552 5.59 91% 7% 12% 7%
5.1 C# .NET #3 4.81 1,881,564 676 15.47 81% 74% 83% 83%
5.2 C# .NET #2 4.89 1,617,228 705 15.77 74% 91% 79% 79%
5.2 C# .NET #7 4.91 1,583,688 694 15.97 76% 92% 77% 81%
5.3 Haskell GHC #7 5.02 449,868 811 18.05 90% 85% 93% 91%
5.3 C# .NET 5.03 1,910,092 657 16.35 83% 79% 84% 79%
5.5 Erlang #2 5.19 419,540 478 15.94 71% 74% 81% 81%
5.5 Haskell GHC #6 5.21 457,732 592 18.75 89% 87% 97% 88%
5.7 Haskell GHC #8 5.32 355,116 799 18.85 93% 89% 88% 85%
6.4 F# .NET #7 6.06 1,469,616 516 16.18 63% 69% 62% 72%
6.5 Racket #3 6.16 317,728 473 6.20 100% 0% 0% 0%
7.6 Haskell GHC #5 7.13 699,576 561 25.82 88% 88% 98% 88%
7.7 Haskell GHC #3 7.21 689,468 538 26.92 90% 98% 92% 93%
7.9 Julia #3 7.43 482,620 634 23.65 69% 100% 78% 72%
8.0 Node js #6 7.52 1,343,968 744 22.37 73% 70% 85% 69%
8.5 Chapel #3 7.96 298,772 488 24.53 99% 74% 76% 58%
9.1 C gcc #5 8.55 351,376 908 31.51 92% 93% 93% 91%
9.5 Racket #2 8.99 318,020 416 9.04 100% 0% 0% 0%
10 Lisp SBCL 9.78 552,028 589 10.02 0% 100% 1% 1%
11 Dart #7 9.90 539,308 863 30.78 83% 74% 70% 85%
11 Dart #4 10.03 510,088 1387 31.01 69% 79% 93% 68%
11 Dart #5 10.24 443,504 1016 28.25 61% 62% 86% 68%
11 OCaml #5 10.54 154,276 461 10.67 100% 1% 0% 0%
12 Erlang 11.74 446,540 420 12.05 6% 88% 1% 7%
13 Node js 11.85 1,085,704 711 34.60 73% 73% 73% 73%
13 Ada 2012 GNAT #3 11.88 528,072 1266 33.61 68% 75% 70% 71%
14 Go #8 12.80 385,036 1017 43.87 85% 87% 85% 86%
14 Go #5 13.40 345,592 950 52.99 99% 99% 99% 99%
15 Go #3 13.83 371,912 799 53.89 97% 97% 99% 97%
15 Haskell GHC 14.10 667,060 494 26.89 30% 30% 30% 100%
15 Haskell GHC #2 14.41 454,324 491 25.94 30% 100% 30% 21%
15 Dart #3 14.53 980,520 1212 49.72 92% 85% 80% 85%
16 Racket 15.27 443,168 476 15.34 0% 100% 0% 0%
16 Dart 15.28 405,784 482 22.81 5% 94% 36% 13%
17 Swift #3 16.15 699,872 862 51.81 77% 66% 79% 100%
17 Swift #2 16.26 699,876 816 51.95 100% 67% 78% 75%
17 VW Smalltalk #3 16.33 375,880 930 37.41 70% 46% 70% 43%
18 Swift #5 16.72 732,888 806 50.18 67% 95% 65% 73%
19 Julia #4 17.43 418,700 372 45.08 57% 66% 74% 61%
20 PHP #7 18.64 1,588,704 760 67.29 89% 90% 96% 86%
20 Swift #4 18.77 699,884 765 59.80 75% 66% 77% 100%
20 Julia #2 19.19 479,728 423 36.92 30% 32% 39% 92%
21 Swift 19.39 733,308 714 58.01 72% 95% 64% 68%
23 PHP #4 21.40 1,558,524 779 64.07 56% 85% 86% 73%
23 C gcc 22.10 263,568 654 22.40 100% 0% 0% 1%
24 Ada 2012 GNAT 22.40 265,456 888 22.69 0% 1% 100% 0%
24 C++ g++ #2 22.47 265,172 508 22.72 0% 0% 100% 1%
25 Ruby #5 23.80 566,560 1008 67.07 58% 96% 63% 64%
30 PHP #6 27.89 804,252 868 92.49 78% 78% 98% 78%
30 Julia #5 28.54 686,764 390 77.14 56% 70% 66% 77%
30 Intel Fortran 28.71 525,624 773 32.74 4% 100% 5% 5%
31 Go #7 29.51 262,832 525 54.41 48% 47% 44% 44%
31 Go 29.53 254,776 482 52.07 42% 42% 47% 45%
35 Node js #7 32.84 1,344,420 451 37.89 31% 30% 29% 25%
36 PHP #5 33.78 777,220 1040 88.44 75% 80% 47% 60%
38 Go #6 35.71 410,828 611 36.85 2% 99% 1% 1%
41 VW Smalltalk 38.24 375,680 711 38.56 0% 0% 100% 0%
51 Lua #4 48.15 923,628 664 178.89 97% 92% 91% 91%
54 Python 3 51.07 278,324 589 178.28 85% 86% 93% 85%
56 Perl #5 53.02 1,048,568 797 195.75 91% 88% 100% 90%
60 Ruby #4 56.61 562,776 364 59.20 0% 1% 4% 100%
62 Ruby 58.17 562,756 376 60.68 2% 2% 4% 96%
62 Ruby #3 58.41 862,008 400 60.56 1% 0% 3% 100%
62 Ruby #2 58.53 562,780 378 61.83 0% 4% 100% 1%
67 PHP 63.06 747,960 451 67.59 2% 2% 3% 100%
68 PHP #2 64.14 747,932 423 68.01 4% 2% 97% 2%
80 Python 3 #3 75.49 677,620 1238 220.59 66% 69% 66% 92%
85 Perl #4 79.85 2,519,676 761 291.24 98% 91% 90% 86%
88 Lua #3 82.85 923,584 684 165.86 44% 50% 87% 20%
121 Perl #3 114.27 2,200,624 648 6 min 97% 74% 90% 78%
157 Lua #2 147.61 947,952 412 148.92 0% 1% 0% 100%
157 Python 3 #2 148.16 274,244 338 149.34 0% 0% 0% 100%
268 Perl 252.06 599,456 395 254.71 100% 1% 0% 0%
336 Matz's Ruby #5 5 min 1,413,456 1008 16 min 73% 72% 75% 95%
603 Matz's Ruby #3 9 min 840,244 400 9 min 0% 3% 0% 97%
731 Matz's Ruby #4 11 min 1,560,732 364 12 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%
PHP #3 Failed
Swift #9 Make Error