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.28 156,780 906 10.12 91% 77% 59% 83%
1.6 Ada 2005 GNAT #5 5.33 160,616 2167 17.40 90% 77% 91% 73%
1.6 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,512 846 6.97 100% 0% 0% 1%
2.3 Rust 7.66 219,308 792 28.32 95% 95% 84% 97%
2.4 C++ g++ #3 7.74 362,676 993 26.36 88% 97% 71% 87%
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 C++ g++ #6 12.86 298,088 892 12.84 1% 100% 1% 1%
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 C++ g++ 13.44 2,941,392 796 51.97 99% 97% 97% 97%
4.1 Scala #4 13.53 520,808 494 18.84 46% 35% 36% 25%
4.2 Clojure #2 13.81 615,132 750 45.65 85% 83% 88% 76%
4.3 C# .NET Core #4 14.25 802,188 955 49.88 88% 89% 89% 87%
4.4 Java #4 14.57 589,976 911 23.24 24% 77% 22% 37%
5.0 F# .NET Core 16.29 680,880 537 18.17 46% 43% 18% 7%
5.6 Clojure 18.49 616,160 657 28.16 33% 45% 37% 49%
6.0 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.2 C# .NET Core #3 20.44 2,920,800 725 64.81 82% 81% 79% 78%
6.3 Haskell GHC #4 20.83 817,104 612 65.44 72% 92% 80% 72%
6.4 C gcc #5 21.14 221,620 963 79.62 88% 97% 97% 97%
6.9 Lisp SBCL #2 22.59 322,012 649 22.55 1% 0% 100% 1%
7.9 OCaml #2 25.82 173,372 784 77.00 89% 95% 54% 64%
8.2 Lisp SBCL 26.82 323,784 612 26.78 12% 1% 1% 88%
8.5 Haskell GHC 28.02 360,468 521 54.58 33% 96% 35% 33%
8.7 Ada 2005 GNAT #3 28.58 658,776 1342 99.60 90% 86% 87% 87%
9.1 Erlang #2 29.83 821,676 499 112.32 93% 93% 93% 99%
10 C# .NET Core 33.44 1,764,516 652 41.81 33% 22% 44% 29%
11 Hack #3 36.00 832,084 480 35.95 1% 100% 0% 0%
11 C# .NET Core #2 37.03 1,230,592 650 41.27 15% 16% 50% 33%
11 Racket #2 37.10 420,556 640 37.04 1% 1% 1% 100%
11 F# .NET Core #2 37.34 682,888 515 41.92 43% 19% 44% 8%
12 Pascal Free Pascal 38.12 131,376 769 38.09 1% 0% 100% 1%
12 C gcc 38.37 132,440 706 38.33 100% 1% 1% 0%
12 Erlang HiPE 38.99 1,043,472 441 38.98 1% 97% 0% 4%
12 C++ g++ #2 39.12 199,680 553 39.08 2% 0% 100% 1%
12 Dart 39.13 598,548 503 53.72 66% 33% 23% 17%
12 Ada 2005 GNAT 39.74 199,920 955 39.70 1% 0% 1% 100%
12 Go #4 39.88 361,208 688 152.12 96% 95% 96% 96%
12 Go #2 40.09 369,124 694 153.61 97% 95% 96% 96%
13 Go #5 41.35 384,112 1000 157.64 96% 96% 96% 96%
13 F# .NET Core #3 41.39 685,008 565 48.39 24% 52% 20% 22%
13 OCaml #5 41.55 263,260 496 41.49 1% 100% 1% 1%
14 Racket 45.56 478,324 495 45.49 1% 0% 0% 100%
16 C# Mono LLVM #2 54.12 454,164 650 57.80 100% 0% 8% 2%
17 C# Mono LLVM 55.04 273,112 652 59.98 77% 1% 29% 7%
17 Node.js 55.50 973,180 477 56.71 2% 0% 100% 2%
17 TypeScript #2 56.04 973,680 470 57.23 56% 26% 1% 20%
17 TypeScript 56.26 973,616 475 57.53 1% 57% 44% 2%
18 Ruby #5 57.98 243,912 1123 168.33 96% 65% 68% 64%
19 Swift #6 61.10 104,460 490 61.06 1% 100% 0% 0%
21 Fortran Intel 68.17 134,076 826 68.14 1% 100% 0% 0%
24 Go #9 77.66 295,608 548 122.54 38% 41% 41% 41%
24 Go 78.52 281,036 516 123.97 36% 44% 43% 36%
24 Go #7 80.25 286,480 567 129.82 42% 46% 39% 38%
25 Smalltalk VW 81.30 331,144 722 81.20 1% 1% 0% 100%
25 Swift #2 83.63 1,166,676 643 89.46 25% 27% 34% 22%
26 C# Mono LLVM #4 86.58 313,192 955 210.45 63% 64% 61% 61%
27 Erlang 89.30 907,220 441 89.22 52% 1% 1% 49%
29 Swift #3 94.29 202,612 484 94.22 0% 1% 1% 100%
29 Swift 95.02 202,476 491 94.95 0% 1% 1% 100%
31 Hack #2 100.85 961,416 468 100.76 19% 21% 62% 0%
33 Hack 109.63 961,088 506 109.54 0% 1% 1% 100%
43 Scala #5 140.66 482,360 688 6 min 72% 71% 70% 72%
46 Ruby JRuby #3 149.36 1,444,868 439 204.64 19% 25% 68% 26%
46 Python 3 152.06 804,624 596 8 min 94% 92% 95% 91%
47 Ruby #4 155.62 243,484 402 155.46 0% 30% 70% 0%
51 Ruby JRuby #4 168.13 2,049,520 402 264.77 32% 55% 42% 33%
53 Ruby JRuby #5 173.69 2,295,976 1123 11 min 97% 96% 96% 95%
53 PHP #3 175.09 1,550,168 483 174.93 98% 4% 1% 0%
61 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%
63 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%
69 Ruby JRuby 227.79 2,303,556 412 8 min 42% 61% 67% 47%
70 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%
Lisp SBCL #3 Bad Output
Swift #5 Make Error
Swift #4 Make Error