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 2.97 105,024 906 9.68 93% 77% 87% 72%
1.3 Rust 3.74 79,216 791 14.15 94% 96% 97% 95%
1.7 Ada 2005 GNAT #4 4.98 107,340 2167 15.11 72% 93% 67% 75%
1.7 Ada 2005 GNAT #5 4.99 113,612 2167 15.14 70% 69% 93% 76%
1.7 C++ g++ #6 5.08 180,752 892 16.57 81% 85% 82% 83%
2.0 Java  #5 5.88 513,180 926 19.64 95% 79% 87% 76%
2.0 Java  #6 5.93 386,484 583 8.26 47% 15% 37% 43%
2.2 Fortran Intel #2 6.57 125,016 1199 19.94 67% 70% 71% 96%
3.0 Go #6 8.95 100,584 752 18.25 53% 50% 50% 50%
3.5 Clojure #2 10.45 534,788 750 33.92 84% 90% 78% 73%
3.9 Scala #2 11.70 711,060 641 36.82 81% 83% 77% 77%
4.3 Haskell GHC #4 12.74 413,228 612 38.17 94% 73% 67% 67%
4.4 Java  #3 13.03 488,716 584 17.91 29% 64% 16% 30%
4.5 Erlang HiPE #2 13.33 534,160 499 48.51 93% 90% 95% 88%
4.6 Java  #2 13.56 505,456 603 19.03 50% 52% 17% 23%
4.7 Scala #4 13.92 513,600 494 19.16 20% 50% 45% 28%
4.9 OCaml #2 14.41 102,344 784 38.41 77% 33% 100% 60%
5.7 Clojure 16.86 532,412 657 24.33 27% 44% 46% 29%
5.8 Go #8 17.08 129,276 814 52.28 77% 76% 76% 78%
6.1 Lisp SBCL #2 18.22 154,980 649 18.19 0% 1% 0% 100%
6.8 Haskell GHC 20.29 180,228 521 42.48 44% 93% 37% 37%
6.8 C# Mono 20.29 116,456 654 21.33 20% 6% 39% 41%
7.7 Clojure #6 22.93 545,252 705 31.64 44% 46% 18% 31%
8.2 Dart 24.34 204,088 503 25.85 27% 69% 9% 2%
8.4 F# Mono 25.02 126,628 537 26.31 6% 80% 20% 1%
9.0 Lisp SBCL 26.55 155,000 612 26.52 1% 0% 0% 100%
9.3 Racket #2 27.73 245,224 640 27.70 8% 1% 1% 93%
11 C# Mono #3 32.85 394,684 723 63.51 49% 48% 49% 46%
11 Pascal Free Pascal 33.21 65,836 769 33.19 1% 1% 1% 100%
12 Racket 34.29 278,232 495 34.26 0% 0% 100% 1%
12 C gcc 34.42 66,784 706 34.40 100% 0% 0% 0%
12 OCaml #5 34.46 138,072 496 34.42 0% 1% 1% 100%
12 Ada 2005 GNAT #3 36.41 331,080 1342 123.90 86% 84% 86% 85%
12 Erlang HiPE 36.44 537,356 441 36.41 1% 3% 0% 97%
12 F# Mono #3 36.68 153,824 565 38.23 100% 5% 1% 1%
14 Ada 2005 GNAT 43.00 101,240 955 42.97 1% 1% 100% 0%
15 C# Mono #2 44.81 254,416 650 46.53 0% 2% 4% 100%
16 C gcc #5 48.80 113,984 963 128.09 52% 61% 72% 80%
18 Go #5 52.51 156,284 1000 169.34 82% 81% 80% 81%
19 Go #4 55.53 165,020 688 190.96 87% 86% 86% 87%
19 Go #2 55.92 165,224 694 190.86 86% 86% 86% 86%
22 F# Mono #2 66.41 213,544 515 69.41 23% 1% 5% 78%
23 Ruby #5 67.48 114,588 1123 193.75 63% 63% 66% 96%
30 Go #9 89.54 138,016 548 163.82 48% 47% 43% 46%
31 Go 91.91 139,492 516 168.59 49% 48% 43% 44%
31 Go #7 92.70 141,676 567 171.23 49% 49% 46% 48%
36 Ruby JRuby #5 106.00 2,243,108 1123 6 min 96% 97% 95% 96%
46 Python 3 136.58 478,168 596 8 min 93% 96% 96% 93%
48 Scala #5 141.83 478,068 688 6 min 77% 73% 72% 76%
59 Ruby JRuby #4 174.40 1,844,572 402 215.63 22% 27% 26% 50%
60 Ruby JRuby #3 178.53 1,449,820 439 214.10 22% 55% 26% 19%
66 Ruby #4 194.32 114,320 402 194.22 1% 99% 0% 2%
68 Fortran Intel 202.38 154,072 826 202.15 98% 4% 5% 2%
69 Ruby JRuby 204.69 2,176,152 412 5 min 49% 34% 30% 53%
78 Ruby #2 230.98 202,420 413 230.87 0% 1% 1% 100%
78 Ruby #3 231.04 159,432 439 230.91 1% 1% 55% 46%
79 Ruby 233.76 202,472 412 233.65 1% 67% 0% 34%
91 Perl #3 268.79 1,018,156 706 14 min 90% 95% 73% 76%
178 PHP #2 8 min 549,952 472 8 min 34% 66% 1% 1%
199 PHP 9 min 546,228 504 9 min 9% 78% 14% 1%
226 PHP #3 11 min 1,255,012 483 11 min 1% 23% 54% 24%
233 Perl 11 min 330,928 448 11 min 10% 34% 64% 13%
C++ g++ #2 Make Error
Go #3 Bad Output
Lisp SBCL #3 Bad Output
Racket #3 Bad Output