The Computer Language
Benchmarks Game

binary-trees

program source code, command-line and measurements

× source secs mem gz cpu cpu load
1.0 C gcc #3 2.55 130,516 836 7.77 82% 66% 64% 94%
1.0 C++ g++ #9 2.63 130,600 809 7.93 98% 68% 62% 76%
1.6 Rust #2 3.98 165,920 721 14.61 90% 100% 90% 89%
1.7 C++ g++ #3 4.42 221,696 945 10.80 86% 45% 71% 45%
1.8 C++ g++ #6 4.52 221,816 844 11.20 50% 61% 49% 90%
2.0 Swift #9 5.11 190,716 1001 14.24 100% 62% 59% 60%
2.0 C++ g++ #8 5.15 221,800 820 13.01 50% 70% 54% 86%
2.7 Rust 6.79 133,428 751 23.29 86% 90% 91% 77%
3.1 C# .NET Core #4 7.81 804,268 810 26.27 91% 80% 83% 84%
3.1 F# .NET Core #6 7.94 1,078,352 611 28.07 89% 87% 88% 91%
3.1 F# .NET Core #8 8.01 1,044,848 619 27.81 93% 86% 84% 87%
3.1 Erlang HiPE #2 8.03 472,836 478 23.07 80% 69% 75% 66%
3.2 Java  #7 8.28 982,224 835 27.19 79% 86% 83% 83%
3.3 Ada 2012 GNAT #5 8.38 202,480 2107 27.65 75% 94% 79% 85%
3.3 Lisp SBCL #3 8.41 364,332 943 21.26 58% 84% 57% 56%
3.3 Ada 2012 GNAT #4 8.46 202,412 2107 26.93 95% 80% 68% 77%
3.4 C++ g++ 8.56 1,864,944 754 31.70 97% 92% 93% 92%
3.8 OCaml #2 9.79 116,008 751 29.43 61% 89% 55% 98%
4.4 Java #4 11.25 783,116 840 13.78 30% 10% 15% 69%
4.5 Hack #4 11.36 396,464 745 34.48 75% 69% 83% 82%
4.6 Java #3 11.74 780,740 540 14.19 51% 25% 15% 32%
4.6 Java #6 11.75 778,112 529 14.08 60% 12% 22% 29%
4.7 Java #2 11.99 708,016 552 14.37 70% 9% 10% 34%
5.5 Chapel #2 13.99 361,924 470 44.80 100% 56% 75% 91%
5.7 C# .NET Core #3 14.52 1,878,456 676 48.01 83% 86% 87% 80%
6.3 C gcc #5 16.06 351,368 908 56.04 92% 80% 85% 92%
6.5 F# .NET Core #7 16.48 1,365,776 516 48.32 81% 69% 67% 78%
6.5 Fortran Intel #2 16.53 102,084 1148 16.51 1% 0% 0% 100%
7.4 C# .NET Core #2 18.81 821,188 586 20.45 31% 23% 40% 18%
8.1 Java AOT #3 20.69 656,812 540 20.67 0% 0% 1% 100%
8.3 Java AOT #7 21.19 843,440 835 43.09 55% 67% 47% 42%
8.5 Java AOT #2 21.70 662,236 552 21.67 0% 1% 100% 0%
8.6 Java AOT #6 21.82 657,124 529 21.79 1% 100% 1% 0%
8.7 OCaml #5 22.22 152,120 461 22.20 0% 1% 100% 0%
8.8 TypeScript #4 22.33 1,080,416 947 75.32 85% 84% 86% 85%
8.9 Ada 2012 GNAT #3 22.65 528,032 1266 74.39 81% 89% 80% 79%
8.9 Erlang HiPE 22.74 611,684 420 22.98 53% 32% 1% 17%
9.0 F# .NET Core #3 22.87 822,732 531 25.04 36% 27% 36% 11%
9.2 Node js #2 23.46 355,612 431 39.77 68% 33% 37% 33%
11 Racket #3 28.06 492,004 473 28.03 34% 1% 1% 67%
11 F# .NET Core 28.42 1,219,920 506 32.81 44% 28% 28% 17%
11 C# .NET Core 28.51 1,203,416 600 32.82 27% 36% 33% 22%
11 Go #4 28.90 471,068 654 110.50 96% 95% 95% 97%
11 C++ g++ #2 29.19 265,276 508 29.17 0% 0% 1% 100%
12 Racket #2 29.56 503,516 416 29.53 0% 100% 1% 0%
12 Hack #3 30.02 396,356 425 29.92 0% 1% 1% 99%
12 Go #2 30.25 441,684 660 115.16 94% 96% 95% 97%
12 F# .NET Core #4 31.09 998,796 488 34.74 24% 40% 39% 11%
12 C gcc 31.29 263,900 654 31.26 0% 100% 1% 0%
12 VW Smalltalk #3 31.71 375,520 959 79.03 55% 57% 72% 67%
13 Go #5 32.09 328,308 950 122.48 97% 97% 94% 95%
13 Java AOT #4 33.60 1,264,328 840 33.55 0% 100% 1% 0%
13 Ada 2012 GNAT 34.33 265,416 888 34.30 100% 1% 1% 0%
14 Free Pascal 36.36 262,180 715 36.33 9% 1% 1% 94%
14 Go #3 36.75 840,444 640 140.85 99% 96% 96% 97%
15 Dart 37.67 562,008 457 49.20 59% 20% 30% 24%
15 F# .NET Core #2 38.93 1,030,716 482 43.29 38% 31% 26% 18%
18 Node js 45.27 652,224 440 97.23 75% 45% 47% 49%
18 Swift 45.52 736,016 714 132.89 74% 69% 95% 56%
18 TypeScript 45.95 663,832 451 96.90 46% 46% 49% 72%
18 TypeScript #2 46.10 645,176 448 97.08 57% 48% 48% 59%
19 Racket 48.97 619,424 476 48.92 0% 49% 2% 51%
21 Ruby #5 52.41 434,004 1107 176.92 88% 85% 77% 89%
22 Go 56.18 256,072 482 97.84 43% 43% 43% 46%
22 Go #9 56.98 251,552 508 98.43 46% 42% 41% 45%
23 Fortran Intel 57.36 525,636 773 57.31 100% 0% 1% 0%
23 Go #7 58.27 284,012 525 101.66 44% 43% 45% 44%
26 JRuby #5 65.14 2,331,188 1083 242.77 93% 96% 92% 94%
26 PHP #6 66.56 736,600 868 244.42 94% 92% 91% 96%
30 VW Smalltalk 76.53 375,276 744 76.44 42% 0% 0% 58%
36 Python 3 92.72 448,844 589 5 min 87% 90% 96% 87%
36 JRuby #3 92.96 1,838,832 400 109.01 41% 26% 21% 30%
39 Ruby #4 98.52 440,796 364 138.27 92% 27% 18% 8%
40 JRuby #4 102.96 1,962,168 364 192.01 54% 50% 56% 29%
42 JRuby #2 108.03 2,334,268 378 228.64 50% 42% 55% 66%
43 JRuby 109.54 2,314,672 376 171.57 41% 25% 45% 56%
46 Ruby 117.09 440,728 376 156.81 24% 42% 60% 10%
46 Ruby #2 117.90 440,736 378 157.64 30% 85% 16% 6%
46 PHP #7 117.96 1,552,064 751 197.20 92% 97% 92% 95%
47 PHP #4 120.71 1,552,064 770 5 min 92% 95% 90% 92%
48 PHP #5 122.34 779,772 1040 228.71 72% 88% 77% 67%
48 Ruby #3 123.40 526,352 400 162.95 68% 27% 10% 32%
54 Hack #2 137.99 659,820 422 137.82 25% 36% 1% 40%
59 Hack 151.10 659,368 451 150.94 79% 22% 1% 0%
70 Perl #3 179.61 2,215,420 648 9 min 94% 91% 71% 75%
88 PHP #3 224.53 1,551,932 428 224.35 27% 73% 1% 0%
90 PHP 229.07 735,080 451 228.88 44% 1% 1% 57%
116 Python 3 #2 295.20 274,456 338 295.07 1% 1% 1% 100%
127 PHP #2 5 min 734,936 423 5 min 58% 1% 4% 39%
167 Perl 7 min 598,812 395 7 min 100% 1% 1% 0%
178 Lua #2 7 min 2,294,260 412 7 min 18% 1% 2% 82%
519 Matz's Ruby #3 22 min 840,012 400 22 min 1% 57% 44% 0%
685 Matz's Ruby #4 29 min 1,558,460 364 29 min 3% 10% 90% 4%
731 Matz's Ruby 31 min 1,558,620 376 31 min 19% 82% 3% 5%
741 Matz's Ruby #2 31 min 1,558,656 378 31 min 0% 26% 75% 0%
F# .NET Core #5 Bad Output
Haskell GHC #2 Make Error
Haskell GHC #6 Make Error
Haskell GHC #5 Make Error
Haskell GHC #3 Make Error
Haskell GHC #4 Make Error
Haskell GHC Make Error
Lisp SBCL #2 Timed Out
Lisp SBCL Timed Out
Matz's Ruby #5 Failed
Truffle Ruby #2 Make Error
Truffle Ruby #5 Make Error
Truffle Ruby #3 Make Error
Truffle Ruby #4 Make Error
Truffle Ruby Make Error