The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source secs mem gz cpu cpu load
1.0 C++ g++ #9 2.36 114,404 809 7.69 86% 71% 87% 85%
1.0 OCaml #2 9.82 115,804 746 28.90 90% 96% 39% 72%
1.0 Fortran Intel #2 5.50 119,140 1148 16.35 64% 64% 100% 71%
1.2 C gcc #3 2.38 131,728 836 7.70 98% 87% 73% 68%
1.3 Rust 6.83 148,320 746 24.01 78% 89% 99% 89%
1.3 OCaml #5 22.99 151,700 456 22.96 1% 100% 0% 1%
1.6 Rust #2 4.66 184,704 717 17.32 92% 91% 91% 100%
1.7 Swift #9 4.90 192,756 997 13.74 99% 60% 62% 62%
1.8 Ada 2005 GNAT #4 7.72 202,276 2101 23.33 70% 79% 90% 68%
1.8 Ada 2005 GNAT #5 7.75 202,308 2101 23.62 69% 96% 78% 66%
2.3 Pascal Free Pascal 36.18 262,180 705 36.15 1% 0% 1% 100%
2.3 C gcc 35.57 263,492 654 35.54 1% 1% 100% 0%
2.3 Fortran Intel 61.39 263,844 773 61.34 100% 0% 0% 1%
2.3 C++ g++ #2 37.33 264,900 508 37.30 0% 100% 1% 0%
2.3 C++ g++ #3 4.23 265,132 945 10.75 71% 53% 54% 80%
2.3 Ada 2005 GNAT 40.62 265,408 881 40.59 1% 1% 0% 100%
2.3 C++ g++ #6 4.17 265,420 844 12.32 90% 75% 100% 36%
2.3 C++ g++ #8 4.73 265,496 820 13.62 41% 100% 67% 84%
2.4 Go #4 34.77 269,068 654 132.04 95% 97% 95% 95%
2.4 Go #5 35.86 272,704 950 140.11 98% 98% 98% 98%
2.4 Python 3 #2 265.47 274,404 338 265.33 1% 0% 100% 1%
2.4 Go #2 35.07 275,868 660 133.58 95% 96% 97% 95%
2.4 Go #7 66.59 279,408 525 108.84 42% 42% 47% 34%
2.5 Go 65.70 283,056 482 105.81 43% 39% 43% 38%
2.5 Go #9 63.49 288,524 508 103.46 43% 38% 46% 38%
2.8 Chapel 14.32 324,660 484 44.15 100% 58% 78% 75%
3.1 C gcc #5 20.52 353,080 908 77.16 96% 95% 94% 92%
3.3 Smalltalk VW #3 31.15 375,020 938 83.72 59% 78% 64% 71%
3.3 Smalltalk VW 76.03 375,100 725 75.93 0% 100% 1% 0%
3.8 Ruby #3 186.48 434,456 400 186.32 2% 0% 100% 1%
3.9 Python 3 86.90 451,548 581 5 min 89% 97% 87% 89%
4.0 Haskell GHC #2 27.73 458,712 486 53.94 45% 41% 65% 72%
4.2 Erlang HiPE 21.05 483,332 420 21.05 1% 1% 1% 99%
4.3 Racket #2 28.12 493,048 416 28.06 100% 0% 1% 0%
4.3 Racket #3 26.58 493,088 473 26.53 1% 0% 100% 1%
4.4 Hack #3 31.25 507,332 425 31.21 1% 1% 100% 0%
4.4 Hack #4 10.87 508,460 736 36.47 87% 98% 74% 79%
4.5 Ruby #5 54.24 510,868 1078 153.99 73% 98% 67% 72%
4.5 Erlang #2 15.51 511,840 478 53.73 88% 83% 91% 86%
4.6 Java  #6 15.13 520,676 529 26.95 69% 56% 28% 28%
4.6 Java #3 14.94 521,004 540 26.03 26% 31% 57% 63%
4.6 Erlang 45.95 521,296 420 45.94 100% 1% 1% 0%
4.6 Ada 2005 GNAT #3 26.40 527,976 1263 96.45 91% 90% 90% 96%
4.7 Lisp SBCL 26.56 538,328 594 26.51 1% 100% 1% 0%
4.7 Java #2 15.73 542,932 552 29.06 35% 36% 66% 52%
4.9 Dart 37.72 555,108 457 48.13 25% 22% 56% 26%
4.9 Ruby #4 144.64 562,464 364 144.49 1% 22% 78% 2%
4.9 Ruby #2 179.00 563,084 378 178.84 1% 100% 0% 2%
4.9 Ruby 180.01 563,124 376 179.85 67% 1% 34% 1%
5.0 Erlang HiPE #2 8.05 571,444 478 27.34 96% 81% 81% 84%
5.2 Java #7 11.26 593,156 835 39.02 85% 88% 90% 88%
5.2 Perl 7 min 598,556 395 7 min 19% 13% 48% 21%
5.4 Racket 46.50 620,368 476 46.43 1% 0% 1% 100%
5.9 Haskell GHC 25.26 673,076 494 52.88 43% 93% 38% 38%
6.0 C# .NET Core #4 7.75 691,332 780 25.24 82% 79% 89% 79%
6.2 Haskell GHC #3 25.29 713,176 538 53.09 38% 38% 90% 48%
6.2 Java #4 17.09 714,012 840 34.22 46% 36% 73% 49%
6.4 PHP #2 6 min 734,364 423 6 min 100% 2% 3% 2%
6.4 PHP 263.74 734,416 451 263.49 3% 100% 2% 3%
6.4 PHP #5 88.07 736,372 1027 247.49 92% 77% 23% 91%
6.4 Swift 45.36 737,300 714 134.14 90% 68% 69% 71%
6.9 C# .NET Core #5 7.08 784,864 851 23.45 82% 85% 83% 84%
7.3 C# .NET Core #2 18.32 832,184 586 20.22 62% 8% 10% 34%
7.4 F# .NET Core #3 22.60 843,912 531 24.93 38% 14% 32% 31%
8.3 Node.js 54.38 948,260 440 55.52 19% 27% 55% 2%
8.3 TypeScript 70.02 954,504 451 71.08 9% 5% 25% 64%
8.4 TypeScript #2 69.52 956,612 448 70.64 9% 58% 9% 27%
8.5 F# .NET Core #2 38.12 976,024 475 41.70 22% 25% 47% 18%
9.0 F# .NET Core #4 31.50 1,031,924 488 35.68 26% 21% 28% 41%
9.1 F# .NET Core 29.17 1,041,880 506 33.37 16% 47% 25% 28%
10 Hack 145.46 1,160,496 451 145.33 100% 1% 1% 0%
10 Hack #2 132.52 1,162,428 422 132.41 2% 1% 0% 100%
11 C# .NET Core 28.15 1,259,620 600 32.78 37% 22% 18% 43%
12 Ruby JRuby #3 95.75 1,319,804 400 125.48 26% 72% 24% 30%
14 PHP #3 241.44 1,551,556 428 241.24 100% 0% 1% 0%
14 PHP #4 275.97 1,551,680 762 5 min 93% 92% 88% 92%
15 Ruby JRuby #5 62.06 1,693,060 1078 230.50 92% 93% 95% 94%
15 Ruby JRuby #4 96.80 1,725,928 364 142.04 20% 80% 31% 19%
15 Ruby JRuby #2 104.13 1,772,576 378 159.13 23% 54% 52% 26%
16 Ruby JRuby 103.56 1,790,696 376 162.56 23% 37% 76% 23%
16 C++ g++ 8.87 1,824,860 754 33.68 95% 95% 95% 99%
16 C# .NET Core #3 15.01 1,824,976 676 48.26 86% 80% 80% 80%
19 Perl #3 197.93 2,133,108 641 10 min 68% 71% 92% 96%
19 Lua #2 6 min 2,194,388 412 6 min 38% 28% 36% 1%
F# .NET Core #5 Bad Output
Haskell GHC #4 Bad Output
Lisp SBCL #2 Bad Output