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.95 115,760 746 29.67 99% 73% 41% 87%
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 7.10 148,180 746 24.90 92% 89% 89% 83%
1.3 OCaml #5 22.87 151,724 456 22.84 1% 0% 0% 100%
1.6 Rust #2 4.27 184,600 714 15.84 98% 92% 92% 92%
1.7 Swift #9 4.88 192,428 997 13.77 91% 61% 69% 63%
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 75.98 374,740 658 75.87 10% 53% 39% 1%
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.2 Erlang HiPE 21.05 483,332 420 21.05 1% 1% 1% 99%
4.2 Dart 41.89 484,776 457 55.98 25% 61% 32% 17%
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 Haskell GHC 26.28 511,444 494 52.69 35% 41% 93% 34%
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 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.1 F# .NET Core 29.64 582,588 506 35.40 30% 19% 39% 34%
5.2 Java #7 11.26 593,156 835 39.02 85% 88% 90% 88%
5.2 F# .NET Core #3 23.71 596,776 531 27.26 36% 20% 36% 27%
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.8 F# .NET Core #4 32.67 662,164 488 38.66 24% 22% 27% 48%
6.0 F# .NET Core #2 39.79 684,416 475 45.43 31% 30% 27% 28%
6.0 C# .NET Core #4 7.40 684,584 780 24.34 86% 83% 81% 83%
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.5 Swift 45.55 739,152 714 135.25 90% 72% 69% 68%
7.3 C# .NET Core #2 17.09 833,424 586 19.13 33% 34% 7% 39%
8.1 Node.js 51.21 931,768 440 51.98 57% 10% 30% 5%
8.2 TypeScript 52.10 933,224 451 52.84 42% 17% 32% 13%
8.2 TypeScript #2 51.88 933,276 448 52.64 48% 17% 14% 26%
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%
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%
14 C# .NET Core 30.22 1,605,128 600 38.02 37% 27% 25% 39%
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%
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%
23 C# .NET Core #3 17.62 2,674,764 676 55.41 85% 76% 78% 78%
F# .NET Core #5 Bad Output
Haskell GHC #4 Bad Output
Lisp SBCL #2 Bad Output