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 1.04 154,824 1122 3.74 88% 100% 88% 86%
1.0 Rust #5 1.04 198,652 765 3.71 86% 85% 100% 86%
1.1 Rust #2 1.12 200,208 721 4.02 87% 86% 86% 100%
1.1 C++ g++ #5 1.19 199,952 885 4.29 88% 87% 87% 98%
1.2 Rust #4 1.24 156,888 756 4.55 89% 89% 100% 89%
1.3 Rust #3 1.32 150,812 754 4.81 88% 89% 89% 99%
1.4 C++ g++ #4 1.47 134,300 1270 3.82 49% 52% 99% 60%
1.7 C gcc #2 1.79 168,760 809 5.35 64% 64% 71% 100%
1.7 C++ g++ #9 1.80 135,712 809 5.06 57% 56% 69% 100%
1.8 C++ g++ #3 1.83 265,268 945 4.65 66% 88% 60% 40%
1.8 C++ g++ #6 1.83 265,728 844 4.65 66% 89% 59% 40%
1.9 Free Pascal #6 1.99 132,728 959 4.97 100% 58% 50% 42%
1.9 Free Pascal #7 2.01 132,732 1003 5.00 100% 58% 42% 49%
1.9 C gcc #3 2.02 133,960 836 5.21 49% 58% 100% 51%
2.0 Free Pascal #5 2.03 132,728 953 4.72 99% 49% 43% 42%
2.0 C++ g++ #8 2.08 265,732 820 5.16 46% 66% 88% 48%
2.1 Rust 2.17 132,968 751 7.78 99% 88% 86% 86%
2.3 C# .NET #6 2.35 807,172 753 7.82 83% 88% 84% 78%
2.3 Intel Fortran #2 2.38 133,752 1148 7.45 100% 70% 70% 73%
2.4 Java  #7 2.50 2,487,096 835 7.90 88% 75% 75% 79%
2.5 C++ g++ 2.63 1,947,564 754 9.01 83% 91% 85% 84%
2.6 F# .NET #5 2.73 719,880 635 9.33 80% 89% 87% 85%
2.7 Lisp SBCL #3 2.84 529,972 932 7.09 73% 46% 63% 67%
3.3 Ada 2012 GNAT #4 3.40 202,376 2107 11.49 82% 89% 83% 83%
3.9 OCaml #2 4.04 152,736 751 11.19 39% 77% 68% 93%
4.0 F# .NET #8 4.15 687,996 769 14.28 83% 82% 89% 90%
4.0 Erlang HiPE #2 4.17 385,804 478 11.73 67% 84% 62% 69%
4.0 Java #4 4.20 2,178,184 840 5.03 37% 40% 28% 14%
4.2 Racket #4 4.35 562,044 853 8.92 44% 47% 64% 50%
4.5 Java #6 4.62 2,002,384 529 5.46 11% 91% 7% 8%
4.5 Java #3 4.65 2,013,384 540 5.51 10% 37% 53% 19%
4.6 Java #2 4.82 1,952,424 552 5.65 15% 49% 37% 17%
4.8 Haskell GHC #7 5.02 449,868 811 18.05 90% 85% 93% 91%
4.9 C# .NET #3 5.12 1,764,596 676 16.57 77% 84% 83% 79%
5.0 Haskell GHC #6 5.21 457,732 592 18.75 89% 87% 97% 88%
5.1 Haskell GHC #8 5.32 355,116 799 18.85 93% 89% 88% 85%
5.7 C# .NET #7 5.89 869,852 719 21.44 95% 90% 89% 91%
5.8 F# .NET #7 6.06 1,469,616 516 16.18 63% 69% 62% 72%
5.9 Racket #3 6.12 319,148 473 6.16 0% 0% 0% 100%
6.4 Go #2 6.68 266,164 745 26.59 100% 99% 99% 100%
6.5 Go #4 6.76 299,504 701 26.36 97% 97% 98% 97%
6.7 Node js #6 6.95 1,309,892 744 21.41 76% 75% 88% 69%
6.9 Haskell GHC #5 7.13 699,576 561 25.82 88% 88% 98% 88%
6.9 Haskell GHC #3 7.21 689,468 538 26.92 90% 98% 92% 93%
7.3 Erlang HiPE 7.53 843,572 420 7.79 62% 37% 2% 3%
7.6 Chapel #3 7.86 298,696 488 24.18 100% 57% 77% 74%
8.1 C gcc #5 8.40 351,432 908 31.24 93% 93% 94% 93%
8.8 Racket #2 9.11 319,176 416 9.34 2% 100% 0% 0%
9.1 OCaml #5 9.42 154,504 461 9.55 1% 0% 1% 100%
9.3 Julia #4 9.67 604,312 372 29.97 75% 84% 72% 78%
9.3 Dart #4 9.71 677,344 1386 31.43 79% 85% 81% 79%
9.4 Lisp SBCL 9.78 552,028 589 10.02 0% 100% 1% 1%
9.6 Node js 9.93 1,274,076 711 34.38 85% 86% 86% 89%
12 Julia #5 12.57 605,308 390 39.74 83% 80% 78% 75%
12 Go #8 12.80 385,036 1017 43.87 85% 87% 85% 86%
13 Go #5 13.40 345,592 950 52.99 99% 99% 99% 99%
13 Go #3 13.83 371,912 799 53.89 97% 97% 99% 97%
14 Haskell GHC 14.10 667,060 494 26.89 30% 30% 30% 100%
14 Haskell GHC #2 14.41 454,324 491 25.94 30% 100% 30% 21%
14 Ada 2012 GNAT #3 14.63 527,860 1266 44.56 76% 74% 80% 75%
14 Dart 14.90 536,376 480 22.96 18% 56% 33% 46%
15 Racket 15.76 437,492 476 15.86 100% 1% 0% 0%
15 Swift #2 15.86 699,612 816 50.77 100% 79% 76% 66%
15 Swift #3 16.02 699,628 862 50.64 77% 75% 100% 64%
16 VW Smalltalk #3 16.33 375,880 930 37.41 70% 46% 70% 43%
17 Dart #3 17.40 1,423,960 1212 63.56 90% 91% 92% 92%
18 PHP #7 18.64 1,588,704 760 67.29 89% 90% 96% 86%
18 Swift #4 18.66 704,224 765 59.94 78% 70% 75% 98%
19 Swift 19.33 733,248 714 57.17 62% 72% 95% 67%
19 Julia #2 19.60 702,748 423 25.12 13% 96% 10% 10%
20 C gcc 21.00 263,616 654 21.09 0% 0% 0% 100%
21 PHP #4 21.40 1,558,524 779 64.07 56% 85% 86% 73%
21 C++ g++ #2 22.18 265,032 508 22.30 0% 0% 0% 100%
23 Ada 2012 GNAT 23.73 265,276 888 23.82 100% 0% 0% 0%
23 Ruby #5 23.80 566,560 1008 67.07 58% 96% 63% 64%
27 PHP #6 27.89 804,252 868 92.49 78% 78% 98% 78%
28 Intel Fortran 28.71 525,624 773 32.74 4% 100% 5% 5%
28 Go #7 29.51 262,832 525 54.41 48% 47% 44% 44%
28 Go 29.53 254,776 482 52.07 42% 42% 47% 45%
31 Node js #7 32.67 1,233,180 451 37.49 21% 38% 32% 23%
33 PHP #5 33.78 777,220 1040 88.44 75% 80% 47% 60%
34 Go #6 35.71 410,828 611 36.85 2% 99% 1% 1%
37 VW Smalltalk 38.24 375,680 711 38.56 0% 0% 100% 0%
46 Lua #4 48.15 923,628 664 178.89 97% 92% 91% 91%
48 Python 3 49.35 278,628 589 174.26 95% 86% 86% 86%
51 Perl #5 53.02 1,048,568 797 195.75 91% 88% 100% 90%
55 Ruby #4 56.61 562,776 364 59.20 0% 1% 4% 100%
56 Ruby 58.17 562,756 376 60.68 2% 2% 4% 96%
56 Ruby #3 58.41 862,008 400 60.56 1% 0% 3% 100%
56 Ruby #2 58.53 562,780 378 61.83 0% 4% 100% 1%
61 PHP 63.06 747,960 451 67.59 2% 2% 3% 100%
62 PHP #2 64.14 747,932 423 68.01 4% 2% 97% 2%
73 Python 3 #3 75.57 677,916 1238 222.16 66% 64% 64% 100%
77 Perl #4 79.85 2,519,676 761 291.24 98% 91% 90% 86%
80 Lua #3 82.85 923,584 684 165.86 44% 50% 87% 20%
110 Perl #3 114.27 2,200,624 648 6 min 97% 74% 90% 78%
140 Python 3 #2 144.87 274,312 338 146.30 0% 0% 0% 100%
142 Lua #2 147.61 947,952 412 148.92 0% 1% 0% 100%
243 Perl 252.06 599,456 395 254.71 100% 1% 0% 0%
305 Matz's Ruby #5 5 min 1,413,456 1008 16 min 73% 72% 75% 95%
547 Matz's Ruby #3 9 min 840,244 400 9 min 0% 3% 0% 97%
663 Matz's Ruby #4 11 min 1,560,732 364 12 min 15% 62% 2% 27%
719 Matz's Ruby 12 min 1,559,732 376 12 min 0% 100% 0% 0%
735 Matz's Ruby #2 12 min 1,558,884 378 12 min 49% 0% 51% 0%
PHP #3 Failed
Swift #9 Make Error