The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source code 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.3 Swift #5 4.15 239,252 934 14.95 94% 93% 93% 83%
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 Scala #2 11.52 686,532 641 36.29 85% 87% 72% 73%
3.5 Java  #7 11.58 649,456 889 40.18 94% 85% 87% 83%
3.9 Swift #4 12.76 155,188 696 12.74 100% 1% 1% 0%
4.1 Java  #2 13.33 519,948 603 18.61 38% 24% 17% 62%
4.1 Java  #3 13.34 517,292 584 18.73 31% 57% 39% 17%
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.3 Java  #6 14.08 515,908 583 19.72 18% 55% 49% 19%
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.1 Haskell GHC #4 19.98 800,820 612 63.76 74% 87% 87% 74%
6.5 C gcc #5 21.20 224,924 963 79.94 96% 89% 97% 97%
7.5 Lisp SBCL #2 24.50 354,192 649 24.45 1% 100% 1% 1%
7.7 F# Mono 25.24 164,216 537 26.78 1% 100% 0% 7%
7.8 Haskell GHC 25.62 361,312 521 53.13 36% 88% 49% 36%
7.9 OCaml #2 25.82 173,372 784 77.00 89% 95% 54% 64%
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.83 421,524 640 36.77 0% 0% 100% 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 45.00 454,644 495 44.94 100% 5% 6% 1%
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%
15 F# Mono #3 50.18 229,696 565 53.19 1% 17% 83% 7%
16 Node.js 51.81 943,052 477 52.94 3% 83% 8% 11%
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 #2 56.84 456,044 650 59.91 6% 0% 100% 1%
18 Ruby #5 57.98 243,912 1123 168.33 96% 65% 68% 64%
18 C# Mono 59.63 273,712 652 63.68 5% 19% 25% 60%
21 Fortran Intel 68.17 134,076 826 68.14 1% 100% 0% 0%
21 F# Mono #2 68.99 282,172 515 72.96 22% 27% 54% 5%
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 Swift #3 95.30 202,728 479 95.22 1% 18% 83% 1%
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 96.91 202,708 490 96.82 10% 3% 18% 69%
30 Ruby JRuby #4 97.69 1,190,220 402 153.50 31% 49% 46% 35%
30 Ruby JRuby #3 98.50 1,191,052 439 149.95 33% 43% 43% 36%
35 Hack 114.69 783,808 506 114.61 39% 37% 25% 1%
38 C# Mono #3 122.72 1,402,140 725 211.13 40% 42% 47% 40%
43 Scala #5 140.66 482,360 688 6 min 72% 71% 70% 72%
47 Python 3 152.06 804,624 596 8 min 94% 92% 95% 91%
47 Ruby JRuby 154.39 1,186,744 412 6 min 72% 52% 54% 62%
48 Ruby #4 155.62 243,484 402 155.46 0% 30% 70% 0%
52 PHP #3 168.15 1,549,916 483 168.01 38% 30% 1% 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%
69 PHP #2 224.37 440,500 472 224.18 1% 100% 0% 1%
72 Ruby JRuby #5 234.86 1,213,984 1123 14 min 96% 95% 96% 95%
73 PHP 237.49 440,508 504 237.30 33% 1% 1% 67%
73 Perl #3 238.05 1,708,468 706 13 min 92% 80% 89% 73%
129 Lua #2 7 min 1,724,000 446 7 min 42% 21% 4% 34%
197 Perl 10 min 548,364 448 10 min 62% 20% 9% 14%
C gcc Make Error
Lisp SBCL #3 Bad Output
Racket #3 Bad Output