The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source secs mem gz cpu cpu load
1.0 Pascal Free Pascal 38.08 131,372 769 38.04 0% 1% 0% 100%
1.0 C gcc 38.37 132,440 706 38.33 100% 1% 1% 0%
1.2 C gcc #3 3.28 156,780 906 10.12 91% 77% 59% 83%
1.2 C++ g++ #9 3.36 158,320 846 10.59 81% 82% 78% 75%
1.2 Ada 2005 GNAT #5 5.37 160,624 2167 17.43 83% 93% 74% 79%
1.2 Ada 2005 GNAT #4 5.42 160,716 2167 17.58 87% 75% 93% 75%
1.3 OCaml #2 23.42 173,568 784 70.56 84% 90% 77% 55%
1.4 Fortran Intel #2 5.98 185,288 1199 18.25 73% 72% 69% 95%
1.5 Ruby #5 58.72 192,132 1123 166.36 67% 61% 68% 90%
1.5 C++ g++ #2 39.12 199,680 553 39.08 2% 0% 100% 1%
1.5 Ada 2005 GNAT 39.47 199,872 955 39.43 0% 1% 100% 0%
1.7 Rust 7.71 220,648 792 28.26 94% 96% 91% 87%
1.7 C gcc #5 21.14 221,620 963 79.62 88% 97% 97% 97%
1.9 Swift #9 5.55 247,508 1062 16.74 65% 74% 70% 95%
2.0 Go 80.60 258,940 516 125.00 40% 43% 37% 37%
2.1 Go #9 77.08 278,044 548 121.15 39% 42% 41% 40%
2.2 Go #7 82.05 289,024 567 131.42 43% 42% 37% 39%
2.6 Chapel 15.65 341,416 554 51.70 100% 81% 80% 71%
2.7 Lisp SBCL #2 21.10 353,248 649 21.06 1% 100% 0% 0%
2.7 Dart 36.49 356,988 503 45.11 38% 43% 24% 21%
2.7 Haskell GHC 28.02 360,468 521 54.58 33% 96% 35% 33%
2.8 Lisp SBCL 25.86 361,492 612 25.81 1% 100% 0% 1%
2.8 C++ g++ #3 7.74 362,676 993 26.36 88% 97% 71% 87%
2.8 C++ g++ #8 7.83 362,732 852 25.72 95% 77% 96% 89%
2.8 C++ g++ #6 7.23 362,820 892 24.45 53% 92% 100% 96%
2.8 Go #4 39.68 364,612 688 150.64 95% 95% 95% 96%
2.9 Go #5 41.38 377,668 1000 163.80 99% 99% 99% 99%
2.9 Go #2 40.29 379,664 694 153.98 96% 96% 95% 96%
2.9 Rust #2 4.94 385,756 764 19.07 96% 96% 96% 100%
3.9 Java  #6 13.77 511,632 583 19.28 76% 18% 17% 31%
3.9 Java #3 13.37 513,400 584 18.98 67% 22% 29% 26%
3.9 Java #2 13.34 514,440 603 18.81 46% 19% 39% 39%
3.9 Scala #5 182.01 518,896 688 6 min 57% 59% 59% 56%
4.0 Scala #4 13.60 531,348 494 19.40 29% 40% 58% 18%
4.4 Swift 45.77 573,944 792 141.40 72% 73% 98% 68%
4.5 Java #4 14.43 586,292 911 22.96 24% 64% 34% 41%
4.6 Clojure #6 19.89 609,624 705 32.28 43% 49% 29% 43%
4.7 Clojure #2 13.81 615,132 750 45.65 85% 83% 88% 76%
4.7 Clojure 18.49 616,160 657 28.16 33% 45% 37% 49%
4.9 Hack #3 35.88 638,536 480 35.84 98% 2% 1% 1%
4.9 Java #7 11.52 643,924 889 40.54 89% 92% 85% 89%
5.0 Ada 2005 GNAT #3 28.11 658,840 1342 97.98 90% 85% 87% 88%
5.6 F# .NET Core #4 15.01 735,640 511 16.63 15% 42% 23% 33%
6.2 Haskell GHC #4 20.83 817,104 612 65.44 72% 92% 80% 72%
6.3 Erlang #2 29.83 821,676 499 112.32 93% 93% 93% 99%
6.3 Python 3 126.07 831,740 596 7 min 93% 93% 93% 99%
6.4 C# .NET Core #4 14.63 844,632 955 52.00 91% 90% 89% 89%
6.4 F# .NET Core 15.89 846,200 537 17.93 31% 45% 7% 32%
6.7 F# .NET Core #2 35.92 882,556 515 40.50 21% 29% 26% 40%
6.8 TypeScript 56.23 890,184 475 57.19 9% 39% 46% 10%
6.8 TypeScript #2 56.22 890,440 470 57.12 70% 2% 2% 30%
6.8 Node.js 55.64 895,396 477 56.61 3% 52% 43% 5%
7.4 Erlang HiPE #2 20.32 968,816 499 64.90 71% 77% 82% 92%
7.9 Erlang HiPE 38.99 1,043,472 441 38.98 1% 97% 0% 4%
8.4 F# .NET Core #3 38.49 1,101,804 565 44.11 22% 23% 32% 39%
8.8 C# .NET Core #2 36.97 1,149,840 650 41.35 13% 53% 17% 30%
11 Perl #3 213.12 1,385,276 706 11 min 97% 72% 96% 72%
12 Ruby JRuby #3 174.71 1,540,044 439 249.90 18% 88% 23% 20%
14 C# .NET Core 33.25 1,791,140 652 41.67 57% 17% 12% 41%
16 Ruby JRuby #4 177.49 2,082,864 402 281.39 30% 32% 27% 71%
17 Ruby JRuby #5 199.39 2,243,540 1123 12 min 97% 97% 97% 96%
18 Ruby JRuby 233.32 2,302,868 412 8 min 44% 80% 49% 42%
21 C# .NET Core #3 20.52 2,717,212 725 67.37 80% 83% 80% 88%
22 C++ g++ 13.44 2,941,392 796 51.97 99% 97% 97% 97%
Erlang Partial
Fortran Intel Partial
Hack #2 Partial
Hack Partial
Lua #2 Partial
OCaml #5 Partial
Perl Partial
PHP #3 Partial
PHP #2 Partial
PHP #4 Partial
PHP Partial
Racket #2 Partial
Racket Partial
Ruby #4 Partial
Ruby #2 Partial
Ruby #3 Partial
Ruby Partial
Smalltalk VW Partial