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.2 Rust 3.83 127,588 791 14.04 95% 93% 93% 87%
1.2 Swift #5 3.96 242,236 934 14.27 84% 94% 95% 90%
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%
3.9 Swift #4 12.76 155,356 696 12.74 1% 1% 1% 100%
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%
5.8 Erlang HiPE #2 18.93 1,013,732 499 69.05 97% 90% 90% 90%
6.1 Clojure #6 19.89 609,624 705 32.28 43% 49% 29% 43%
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 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.5 Erlang #2 31.15 1,155,600 499 114.83 98% 94% 90% 88%
11 Hack #3 35.00 652,736 480 34.96 1% 0% 1% 100%
11 Racket #2 36.61 412,160 640 36.56 40% 60% 0% 1%
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.76 1,038,048 441 38.71 4% 22% 75% 1%
12 Dart 38.82 338,260 503 52.23 60% 48% 10% 18%
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%
14 Racket 46.61 329,652 495 46.54 1% 0% 0% 100%
15 F# Mono #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 JavaScript V8 48.92 937,612 467 49.31 59% 21% 1% 22%
15 Go #5 50.05 314,688 1000 188.33 95% 95% 94% 94%
16 Node.js 51.71 939,676 477 52.90 37% 5% 1% 61%
17 C# Mono #2 53.86 454,112 650 57.51 100% 7% 1% 0%
17 TypeScript #2 54.00 955,904 470 55.33 75% 27% 1% 2%
17 TypeScript 54.11 950,564 475 55.44 1% 2% 1% 100%
17 C# Mono 54.90 271,172 652 59.80 100% 7% 3% 1%
18 Ruby #5 57.98 243,912 1123 168.33 96% 65% 68% 64%
19 F# Mono #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%
25 Smalltalk VW 82.84 330,808 722 82.75 100% 0% 1% 0%
27 Erlang 88.35 792,632 441 88.27 76% 1% 1% 25%
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%
30 Swift #3 96.72 202,836 479 96.63 0% 1% 100% 0%
30 Swift 97.80 202,840 490 97.72 1% 100% 0% 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%
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%
98 C# Mono #3 5 min 2,103,600 725 18 min 88% 88% 88% 87%
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