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 low-level programs written for SIMD.

× source secs mem gz busy cpu load
1.0 Free Pascal #7 3.06 132,852 1003 10.34 100% 89% 70% 80%
1.0 Free Pascal #6 3.10 132,852 959 10.51 90% 88% 71% 91%
1.1 Free Pascal #5 3.31 132,740 953 10.63 89% 70% 71% 91%
1.1 Rust #2 3.37 199,752 721 12.26 100% 88% 88% 87%
1.2 C gcc #2 3.53 168,764 809 11.64 74% 99% 72% 85%
1.2 Rust #4 3.73 183,948 756 13.57 98% 90% 90% 87%
1.2 Rust #3 3.82 162,512 754 14.01 89% 99% 89% 90%
1.3 C gcc #3 3.88 113,940 836 12.56 86% 76% 78% 84%
1.3 C++ g++ #9 3.93 113,768 809 12.78 70% 81% 75% 98%
1.8 Intel Fortran #2 5.50 112,816 1148 15.85 72% 65% 61% 90%
1.8 C# .NET Core #6 5.59 905,364 753 20.01 92% 88% 87% 91%
1.9 C++ g++ #6 5.76 221,924 844 16.76 84% 40% 90% 78%
1.9 C++ g++ #3 5.78 221,804 945 16.74 39% 83% 77% 90%
2.0 F# .NET Core #5 6.12 765,944 635 22.40 93% 92% 91% 90%
2.1 C++ g++ #8 6.32 221,912 820 16.80 90% 65% 63% 47%
2.2 Rust 6.64 133,072 751 24.17 89% 87% 99% 89%
2.3 F# .NET Core #8 7.10 834,244 769 24.28 87% 89% 85% 81%
2.7 Erlang HiPE #2 8.18 464,444 478 24.76 87% 72% 72% 71%
2.7 Java  #7 8.25 964,656 835 27.65 79% 96% 76% 84%
2.7 Lisp SBCL #3 8.40 396,936 932 21.18 50% 58% 63% 81%
2.9 C++ g++ 8.90 2,049,812 754 32.94 92% 97% 91% 91%
3.0 Ada 2012 GNAT #4 9.25 202,428 2107 31.82 95% 81% 84% 84%
3.2 OCaml #2 9.90 152,988 751 28.24 82% 87% 43% 73%
3.6 Java #3 11.02 776,720 540 13.84 16% 8% 12% 89%
3.8 Java #2 11.60 774,628 552 14.46 9% 11% 9% 96%
3.9 Java #4 11.81 728,548 840 14.38 66% 8% 9% 38%
3.9 Java #6 11.94 729,612 529 14.46 64% 8% 11% 38%
4.2 Haskell GHC #6 12.96 476,448 592 47.98 92% 92% 93% 94%
4.5 C# .NET Core #3 13.74 1,684,524 676 46.57 87% 85% 85% 82%
4.7 Chapel #2 14.49 367,308 474 43.95 100% 56% 73% 75%
5.1 F# .NET Core #7 15.49 1,601,296 516 50.69 78% 89% 82% 79%
5.3 Haskell GHC #5 16.12 687,556 561 59.86 92% 91% 93% 95%
5.5 Racket #4 16.75 983,564 853 46.47 65% 82% 48% 83%
5.7 Dart #4 17.29 813,492 1349 43.83 80% 66% 53% 55%
5.7 Haskell GHC #3 17.57 694,596 538 66.23 95% 93% 93% 96%
5.8 Node js #6 17.71 1,053,736 744 63.60 90% 89% 89% 91%
6.0 C gcc #5 18.32 351,420 908 65.43 89% 85% 90% 93%
6.6 Julia #4 20.10 602,204 372 66.09 79% 83% 90% 77%
7.1 OCaml #5 21.64 154,588 461 22.02 0% 1% 1% 100%
7.8 Haskell GHC 24.01 667,252 494 48.31 33% 59% 75% 33%
8.0 Erlang HiPE 24.55 604,012 420 25.63 87% 3% 3% 12%
8.0 Ada 2012 GNAT #3 24.56 528,312 1266 82.94 84% 82% 82% 89%
8.3 Dart 25.48 797,004 457 29.62 78% 11% 11% 16%
8.4 Go #5 25.68 361,532 950 101.67 99% 99% 99% 99%
8.6 Go #3 26.33 368,300 799 102.39 97% 98% 97% 97%
8.7 Lisp SBCL 26.60 531,428 589 26.82 0% 0% 100% 1%
8.8 Go #4 27.06 367,164 654 103.46 95% 95% 97% 95%
8.9 Go #2 27.17 358,556 660 103.47 96% 94% 95% 95%
9.3 Racket #3 28.58 504,328 473 28.91 0% 28% 72% 1%
9.5 Dart #3 29.00 1,662,480 1206 94.10 82% 82% 79% 82%
9.5 Haskell GHC #2 29.04 455,264 491 60.60 36% 78% 59% 36%
9.8 Racket #2 29.89 511,844 416 30.33 1% 12% 88% 1%
11 VW Smalltalk #3 32.47 376,016 930 81.92 61% 89% 34% 68%
12 Julia #2 36.47 587,124 423 37.18 1% 1% 93% 8%
13 Swift #2 38.24 702,560 816 121.57 62% 76% 80% 100%
13 C++ g++ #2 38.33 265,060 508 38.97 36% 1% 1% 64%
13 Swift #3 38.64 702,732 862 122.44 100% 77% 65% 74%
13 C gcc 39.72 263,676 654 40.16 100% 0% 1% 0%
14 Ada 2012 GNAT 42.44 265,420 888 43.87 37% 1% 2% 63%
14 Swift #4 43.80 702,720 765 137.68 75% 67% 72% 100%
15 Ruby #5 44.61 531,600 1096 125.16 67% 72% 60% 81%
15 Swift 44.94 733,788 714 133.48 58% 74% 70% 95%
16 Racket 49.04 657,808 476 49.65 0% 11% 89% 1%
17 PHP #7 50.59 1,584,444 751 182.39 87% 86% 99% 90%
18 PHP #6 56.49 754,960 868 208.74 91% 91% 90% 97%
18 Go 56.54 249,696 482 102.92 50% 41% 45% 46%
19 Node js #7 57.26 817,724 451 127.34 50% 57% 65% 50%
19 Go #7 58.21 256,844 525 107.00 41% 47% 49% 46%
20 Intel Fortran 60.72 525,628 773 61.38 78% 0% 0% 23%
20 PHP #4 62.16 1,554,328 770 193.52 74% 71% 71% 94%
24 PHP #5 73.79 733,236 1040 208.73 84% 93% 59% 48%
25 VW Smalltalk 75.50 375,636 711 76.22 0% 0% 100% 1%
25 Go #6 77.45 367,776 611 80.28 97% 3% 1% 2%
26 Python 3 80.30 448,004 589 286.50 95% 87% 87% 88%
37 Ruby #4 112.63 577,948 364 114.72 62% 0% 1% 39%
37 Python 3 #3 113.34 677,608 1238 5 min 72% 61% 93% 64%
41 Perl #4 124.49 2,519,232 761 7 min 90% 86% 91% 91%
48 Ruby 148.19 577,892 376 151.33 1% 97% 4% 1%
49 Ruby #2 148.53 577,904 378 153.43 68% 2% 1% 33%
49 Ruby #3 149.94 449,240 400 153.65 23% 22% 42% 16%
50 PHP #3 153.58 1,557,200 428 156.36 12% 0% 72% 17%
50 Lua #4 154.13 1,084,256 664 8 min 76% 71% 87% 81%
55 PHP 168.54 738,472 451 172.02 16% 0% 0% 85%
56 Perl #3 172.50 2,200,640 648 9 min 72% 87% 73% 100%
57 Lua #3 173.30 1,084,196 684 6 min 66% 39% 59% 60%
60 PHP #2 182.03 743,760 423 186.16 3% 1% 98% 1%
83 Python 3 #2 254.66 274,564 338 258.71 80% 0% 0% 20%
137 Perl 6 min 599,248 395 7 min 99% 0% 1% 1%
153 Lua #2 7 min 2,358,616 412 7 min 1% 1% 100% 0%
415 Matz's Ruby #3 21 min 839,888 400 21 min 60% 0% 40% 0%
566 Matz's Ruby #4 28 min 1,558,556 364 29 min 100% 0% 1% 0%
598 Matz's Ruby #2 30 min 1,558,496 378 30 min 11% 1% 1% 88%
600 Matz's Ruby 30 min 1,558,448 376 30 min 77% 1% 1% 24%
Go #9 Make Error
Haskell GHC #4 Bad Output
Matz's Ruby #5 Failed
Swift #9 Make Error