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.24 156,848 906 10.15 85% 62% 78% 92%
1.2 Rust 3.81 129,700 791 14.10 94% 95% 99% 84%
1.2 Swift #5 3.93 240,672 934 14.21 84% 93% 88% 99%
1.6 Ada 2005 GNAT #4 5.32 178,956 2167 17.84 83% 74% 91% 92%
1.7 Ada 2005 GNAT #5 5.37 177,912 2167 17.67 80% 90% 72% 92%
1.9 Fortran Intel #2 6.08 185,084 1199 19.18 100% 70% 76% 72%
1.9 Java  #5 6.20 524,828 926 20.90 87% 91% 82% 80%
2.4 C++ g++ #6 7.72 362,628 892 24.49 84% 70% 97% 69%
3.3 Go #6 10.82 282,052 869 28.01 70% 66% 77% 47%
3.6 Scala #2 11.52 686,532 641 36.29 85% 87% 72% 73%
4.0 Swift #4 12.87 155,256 696 12.86 1% 0% 0% 100%
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.2 Scala #4 13.53 520,808 494 18.84 46% 35% 36% 25%
4.3 Clojure #2 14.07 607,276 750 46.55 83% 90% 80% 80%
4.3 Java  #6 14.08 515,908 583 19.72 18% 55% 49% 19%
4.4 C++ g++ 14.21 2,894,364 796 54.91 97% 97% 97% 98%
5.7 Clojure 18.53 605,464 657 28.28 48% 28% 26% 54%
5.8 Erlang HiPE #2 18.93 1,013,732 499 69.05 97% 90% 90% 90%
6.1 Clojure #6 19.68 606,868 705 28.90 24% 39% 55% 31%
6.2 Haskell GHC #4 19.98 800,820 612 63.76 74% 87% 87% 74%
6.5 C gcc #5 20.98 221,848 963 79.69 96% 97% 90% 98%
7.6 OCaml #2 24.56 204,308 784 70.78 72% 96% 38% 85%
7.6 C# Mono 24.59 163,812 654 26.21 7% 0% 100% 1%
7.6 Lisp SBCL #2 24.79 306,652 649 24.74 99% 1% 1% 0%
7.8 F# Mono 25.25 163,392 537 26.80 6% 29% 71% 2%
7.9 Haskell GHC 25.62 361,312 521 53.13 36% 88% 49% 36%
8.5 Ada 2005 GNAT #3 27.65 658,828 1342 99.92 90% 90% 90% 94%
9.4 Dart 30.55 335,732 503 33.22 77% 11% 2% 21%
9.6 Erlang #2 31.15 1,155,600 499 114.83 98% 94% 90% 88%
10 Lisp SBCL 32.77 325,092 612 32.71 1% 16% 85% 0%
11 Racket #2 36.53 480,712 640 36.48 0% 100% 1% 1%
12 C gcc 37.71 132,384 706 37.68 1% 100% 0% 1%
12 C++ g++ #2 37.89 199,588 553 37.86 26% 0% 1% 74%
12 Pascal Free Pascal 38.12 131,376 769 38.09 1% 0% 100% 1%
12 Erlang HiPE 38.76 1,038,048 441 38.71 4% 22% 75% 1%
12 Ada 2005 GNAT 39.27 199,980 955 39.24 100% 0% 1% 0%
14 OCaml #5 44.24 275,936 496 44.18 28% 61% 1% 13%
14 Racket 45.72 551,940 495 45.66 1% 1% 66% 34%
15 JavaScript V8 48.92 937,612 467 49.31 59% 21% 1% 22%
15 F# Mono #3 50.18 229,696 565 53.19 1% 17% 83% 7%
18 C# Mono #2 56.84 456,044 650 59.91 6% 0% 100% 1%
18 Go #5 57.44 290,640 1000 185.39 82% 81% 81% 81%
18 Ruby #5 57.98 243,912 1123 168.33 96% 65% 68% 64%
19 Go #4 60.10 324,420 688 210.14 88% 88% 88% 88%
19 Go #2 60.86 323,160 694 210.88 87% 87% 87% 87%
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 TypeScript Node.js #2 80.29 955,212 470 80.62 100% 1% 1% 0%
25 TypeScript Node.js 80.81 955,168 475 81.10 1% 76% 24% 1%
26 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%
29 Go 92.63 277,364 516 172.27 49% 48% 46% 46%
29 Go #9 93.38 279,880 548 172.43 49% 45% 47% 47%
29 Swift #3 95.14 202,792 479 95.06 25% 64% 8% 5%
30 Go #7 96.02 277,520 567 180.32 53% 45% 49% 44%
30 Swift 96.04 202,752 490 95.96 40% 5% 56% 1%
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%
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%
48 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%
64 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%
130 Lua #2 7 min 1,724,000 446 7 min 42% 21% 4% 34%
199 Perl 10 min 548,364 448 10 min 62% 20% 9% 14%
Hack #2 Make Error
Hack #3 Make Error
Hack Make Error
Lisp SBCL #3 Bad Output
Racket #3 Bad Output