The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source secs mem gz cpu cpu load
1.0 Python 3 #2 265.47 274,404 338 265.33 1% 0% 100% 1%
1.1 Ruby #4 144.64 562,464 364 144.49 1% 22% 78% 2%
1.1 Ruby JRuby #4 100.38 1,895,548 364 123.41 10% 36% 71% 9%
1.1 Ruby JRuby 112.95 2,436,368 376 165.85 24% 40% 45% 41%
1.1 Ruby 180.01 563,124 376 179.85 67% 1% 34% 1%
1.1 Ruby JRuby #2 110.01 2,445,784 378 213.46 54% 49% 43% 57%
1.1 Ruby #2 179.00 563,084 378 178.84 1% 100% 0% 2%
1.2 Perl 7 min 598,556 395 7 min 19% 13% 48% 21%
1.2 Ruby JRuby #3 90.25 1,933,560 400 106.08 57% 10% 9% 46%
1.2 Ruby #3 186.48 434,456 400 186.32 2% 0% 100% 1%
1.2 Lua #2 6 min 2,194,388 412 6 min 38% 28% 36% 1%
1.2 Racket #2 28.32 500,936 416 28.28 1% 100% 0% 1%
1.2 Erlang HiPE 21.05 483,332 420 21.05 1% 1% 1% 99%
1.2 Erlang 45.95 521,296 420 45.94 100% 1% 1% 0%
1.2 Hack #2 132.52 1,162,428 422 132.41 2% 1% 0% 100%
1.3 PHP #2 6 min 734,364 423 6 min 100% 2% 3% 2%
1.3 Hack #3 31.25 507,332 425 31.21 1% 1% 100% 0%
1.3 PHP #3 241.44 1,551,556 428 241.24 100% 0% 1% 0%
1.3 Node.js 53.64 918,808 440 55.05 68% 2% 5% 30%
1.3 TypeScript #2 53.18 918,148 448 54.56 53% 12% 38% 2%
1.3 TypeScript 53.28 918,224 451 54.65 19% 2% 12% 72%
1.3 Hack 145.46 1,160,496 451 145.33 100% 1% 1% 0%
1.3 PHP 263.74 734,416 451 263.49 3% 100% 2% 3%
1.3 OCaml #5 22.99 151,700 456 22.96 1% 100% 0% 1%
1.4 Dart 37.72 555,108 457 48.13 25% 22% 56% 26%
1.4 Racket #3 26.96 501,036 473 26.92 1% 1% 1% 100%
1.4 F# .NET Core #2 38.60 988,172 475 42.80 30% 26% 29% 27%
1.4 Racket 47.51 625,888 476 47.44 1% 100% 0% 1%
1.4 Erlang #2 15.51 511,840 478 53.73 88% 83% 91% 86%
1.4 Erlang HiPE #2 8.05 571,444 478 27.34 96% 81% 81% 84%
1.4 Go 66.16 281,744 482 106.08 39% 40% 40% 44%
1.4 Chapel 14.32 324,660 484 44.15 100% 58% 78% 75%
1.4 Haskell GHC #2 27.73 458,712 486 53.94 45% 41% 65% 72%
1.4 F# .NET Core #4 31.24 950,008 488 35.22 19% 44% 23% 28%
1.5 Haskell GHC 25.26 673,076 494 52.88 43% 93% 38% 38%
1.5 F# .NET Core 28.87 1,130,320 506 33.84 22% 52% 17% 28%
1.5 C++ g++ #2 37.33 264,900 508 37.30 0% 100% 1% 0%
1.5 Go #9 65.78 290,488 508 104.66 30% 43% 43% 45%
1.6 Go #7 68.60 281,800 525 110.84 38% 41% 40% 45%
1.6 Java  #6 12.79 885,320 529 16.48 80% 14% 11% 27%
1.6 F# .NET Core #3 22.63 844,248 531 24.99 45% 20% 10% 38%
1.6 Haskell GHC #3 25.29 713,176 538 53.09 38% 38% 90% 48%
1.6 Java #3 12.26 891,432 540 16.02 15% 17% 90% 12%
1.6 Java #2 12.47 891,852 552 16.19 38% 11% 70% 15%
1.7 Python 3 86.90 451,548 581 5 min 89% 97% 87% 89%
1.7 C# .NET Core #2 17.82 835,196 586 20.17 12% 43% 44% 17%
1.8 Lisp SBCL 26.90 536,352 594 26.86 0% 1% 1% 100%
1.8 C# .NET Core 28.21 1,171,628 600 32.68 54% 14% 22% 28%
1.9 Perl #3 197.93 2,133,108 641 10 min 68% 71% 92% 96%
1.9 Go #4 35.27 276,956 654 132.77 95% 95% 94% 93%
1.9 C gcc 35.57 263,492 654 35.54 1% 1% 100% 0%
2.0 Go #2 35.18 277,864 660 132.94 96% 94% 94% 95%
2.0 C# .NET Core #3 15.66 1,866,012 676 49.48 79% 82% 78% 80%
2.1 Pascal Free Pascal 36.18 262,180 705 36.15 1% 0% 1% 100%
2.1 Swift 50.67 737,228 714 149.47 96% 67% 63% 72%
2.1 Rust #2 4.38 188,656 717 16.31 92% 92% 100% 92%
2.1 Smalltalk VW 76.03 375,100 725 75.93 0% 100% 1% 0%
2.2 Hack #4 10.87 508,460 736 36.47 87% 98% 74% 79%
2.2 OCaml #2 9.82 115,804 746 28.90 90% 96% 39% 72%
2.2 Rust 6.34 148,420 746 22.24 99% 86% 91% 79%
2.2 C++ g++ 8.87 1,824,860 754 33.68 95% 95% 95% 99%
2.3 PHP #4 275.97 1,551,680 762 5 min 93% 92% 88% 92%
2.3 Fortran Intel 61.39 263,844 773 61.34 100% 0% 0% 1%
2.3 C# .NET Core #4 7.86 724,552 780 25.56 89% 81% 82% 78%
2.4 C++ g++ #9 2.36 114,404 809 7.69 86% 71% 87% 85%
2.4 C++ g++ #8 4.73 265,496 820 13.62 41% 100% 67% 84%
2.5 Java #7 8.58 966,808 835 28.98 86% 84% 90% 81%
2.5 C gcc #3 2.38 131,728 836 7.70 98% 87% 73% 68%
2.5 Java #4 11.91 853,280 840 16.73 12% 13% 95% 24%
2.5 C++ g++ #6 4.17 265,420 844 12.32 90% 75% 100% 36%
2.5 C# .NET Core #5 7.26 716,568 851 23.98 84% 82% 81% 87%
2.6 Ada 2005 GNAT 40.62 265,408 881 40.59 1% 1% 0% 100%
2.7 C gcc #5 20.52 353,080 908 77.16 96% 95% 94% 92%
2.8 Smalltalk VW #3 31.15 375,020 938 83.72 59% 78% 64% 71%
2.8 C++ g++ #3 4.23 265,132 945 10.75 71% 53% 54% 80%
2.8 Go #5 37.33 261,956 950 142.25 97% 95% 96% 95%
2.9 Swift #9 4.96 192,596 997 13.89 60% 63% 61% 99%
3.0 PHP #5 88.07 736,372 1027 247.49 92% 77% 23% 91%
3.2 Ruby JRuby #5 67.41 2,442,336 1078 227.30 91% 86% 82% 80%
3.2 Ruby #5 54.24 510,868 1078 153.99 73% 98% 67% 72%
3.4 Fortran Intel #2 5.50 119,140 1148 16.35 64% 64% 100% 71%
3.7 Ada 2005 GNAT #3 26.40 527,976 1263 96.45 91% 90% 90% 96%
6.2 Ada 2005 GNAT #4 7.72 202,276 2101 23.33 70% 79% 90% 68%
6.2 Ada 2005 GNAT #5 7.75 202,308 2101 23.62 69% 96% 78% 66%
F# .NET Core #5 Bad Output
Haskell GHC #4 Bad Output
Lisp SBCL #2 Bad Output