The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source secs KB gz cpu cpu load
1.0 C gcc #3 3.26 156,840 906 10.12 59% 76% 78% 99%
1.3 Rust 4.17 128,036 791 15.02 98% 95% 93% 77%
1.6 Ada 2005 GNAT #5 5.33 160,616 2167 17.40 90% 77% 91% 73%
1.7 Ada 2005 GNAT #4 5.40 160,604 2167 17.32 88% 71% 91% 75%
1.9 Fortran Intel #2 6.08 185,084 1199 19.18 100% 70% 76% 72%
2.1 C++ g++ #7 6.98 150,564 846 6.97 100% 1% 0% 1%
2.3 C++ g++ #6 7.66 362,656 892 25.24 66% 83% 97% 86%
2.4 C++ g++ #3 7.71 362,584 993 25.30 78% 90% 66% 97%
3.5 Java  #7 11.51 622,328 889 40.10 86% 86% 92% 87%
3.5 Scala #2 11.52 686,532 641 36.29 85% 87% 72% 73%
4.1 Java #2 13.34 516,836 603 18.69 40% 25% 26% 52%
4.1 Java #3 13.36 517,024 584 18.99 19% 37% 28% 60%
4.1 Java #6 13.41 515,676 583 18.69 72% 19% 30% 21%
4.1 Scala #4 13.53 520,808 494 18.84 46% 35% 36% 25%
4.1 C++ g++ 13.53 2,862,212 796 52.16 97% 97% 97% 99%
4.2 Clojure #2 13.81 615,132 750 45.65 85% 83% 88% 76%
4.5 Java #4 14.57 589,976 911 23.24 24% 77% 22% 37%
5.7 Clojure 18.49 616,160 657 28.16 33% 45% 37% 49%
6.1 Chapel 19.83 264,492 554 64.40 100% 83% 80% 64%
6.1 Clojure #6 19.89 609,624 705 32.28 43% 49% 29% 43%
6.2 Erlang HiPE #2 20.32 968,816 499 64.90 71% 77% 82% 92%
6.4 Haskell GHC #4 20.83 817,104 612 65.44 72% 92% 80% 72%
6.5 C gcc #5 21.20 224,924 963 79.94 96% 89% 97% 97%
7.2 F# Mono LLVM 23.50 160,992 537 25.42 9% 100% 1% 1%
7.5 Lisp SBCL #2 24.50 354,192 649 24.45 1% 100% 1% 1%
7.9 OCaml #2 25.82 173,372 784 77.00 89% 95% 54% 64%
8.6 Haskell GHC 28.02 360,468 521 54.58 33% 96% 35% 33%
8.8 Ada 2005 GNAT #3 28.58 658,776 1342 99.60 90% 86% 87% 87%
8.8 Lisp SBCL 28.63 323,480 612 28.57 41% 63% 1% 3%
9.1 Erlang #2 29.83 821,676 499 112.32 93% 93% 93% 99%
11 Hack #3 35.00 652,736 480 34.96 1% 0% 1% 100%
11 Racket #2 37.10 420,556 640 37.04 1% 1% 1% 100%
12 Pascal Free Pascal 38.12 131,376 769 38.09 1% 0% 100% 1%
12 C++ g++ #2 38.38 199,640 553 38.35 45% 5% 51% 1%
12 Erlang HiPE 38.99 1,043,472 441 38.98 1% 97% 0% 4%
12 Ada 2005 GNAT 39.74 199,920 955 39.70 1% 0% 1% 100%
13 OCaml #5 41.55 263,260 496 41.49 1% 100% 1% 1%
13 Dart 42.13 521,828 503 58.72 30% 70% 22% 19%
14 Racket 45.56 478,324 495 45.49 1% 0% 0% 100%
15 F# Mono LLVM #3 47.51 256,192 565 51.09 0% 9% 1% 100%
15 Go #2 47.71 322,256 694 185.02 98% 97% 97% 97%
15 Go #4 48.57 322,976 688 187.74 98% 97% 97% 96%
15 Go #5 50.05 314,688 1000 188.33 95% 95% 94% 94%
16 Node.js 52.79 954,084 477 53.92 11% 9% 80% 6%
17 C# Mono LLVM #2 54.12 454,164 650 57.80 100% 0% 8% 2%
17 TypeScript #2 54.12 955,356 470 55.26 2% 1% 100% 2%
17 TypeScript 54.21 955,816 475 55.44 20% 2% 2% 81%
17 C# Mono LLVM 55.04 273,112 652 59.98 77% 1% 29% 7%
18 Ruby #5 57.98 243,912 1123 168.33 96% 65% 68% 64%
19 C# .NET Core #2 62.48 543,156 650 68.62 62% 12% 27% 10%
19 F# Mono LLVM #2 63.21 278,484 515 68.03 9% 0% 100% 1%
21 Fortran Intel 68.17 134,076 826 68.14 1% 100% 0% 0%
21 C# .NET Core 68.34 1,395,888 652 72.78 64% 6% 29% 10%
25 Smalltalk VW 81.30 331,144 722 81.20 1% 1% 0% 100%
27 Erlang 89.30 907,220 441 89.22 52% 1% 1% 49%
28 Go #9 91.90 277,308 548 162.58 45% 44% 46% 45%
29 Go 94.94 278,404 516 170.78 47% 45% 46% 45%
29 Go #7 95.65 281,952 567 175.65 48% 50% 45% 43%
30 Hack #2 96.58 783,792 468 96.51 0% 1% 100% 1%
35 Hack 114.69 783,808 506 114.61 39% 37% 25% 1%
43 Scala #5 140.66 482,360 688 6 min 72% 71% 70% 72%
45 Ruby JRuby #5 146.20 2,288,800 1123 9 min 96% 97% 96% 95%
46 C# .NET Core #3 148.60 1,531,860 725 187.67 28% 30% 32% 39%
47 Python 3 152.06 804,624 596 8 min 94% 92% 95% 91%
48 Ruby #4 155.62 243,484 402 155.46 0% 30% 70% 0%
48 Ruby JRuby #4 156.86 2,215,092 402 235.25 28% 69% 29% 26%
54 PHP #3 175.09 1,550,168 483 174.93 98% 4% 1% 0%
58 Ruby JRuby 190.64 2,194,732 412 6 min 60% 45% 34% 55%
61 Ruby JRuby #3 198.23 2,216,728 439 6 min 34% 71% 46% 34%
62 Ruby 200.83 432,092 412 200.65 59% 0% 0% 42%
63 Ruby #2 206.69 432,132 413 206.50 18% 61% 1% 22%
64 Ruby #3 207.76 575,052 439 207.53 48% 5% 40% 10%
65 Perl #3 213.12 1,385,276 706 11 min 97% 72% 96% 72%
71 PHP #2 230.68 440,540 472 230.46 1% 100% 0% 1%
73 PHP 238.11 440,464 504 237.90 0% 1% 1% 100%
86 C# Mono LLVM #3 282.03 1,259,240 725 16 min 89% 87% 86% 86%
129 Lua #2 7 min 1,724,000 446 7 min 42% 21% 4% 34%
160 Perl 8 min 351,036 448 8 min 47% 1% 10% 44%
C gcc Make Error
Lisp SBCL #3 Bad Output
Swift Make Error
Swift #5 Make Error
Swift #4 Make Error
Swift #3 Make Error