The Computer Language
Benchmarks Game

binary-trees

Always look at the source code.

Look at the slower simple sequential programs, and  look at the parallel programs written for multicore, and  look at the low-level programs written for SIMD.

× source secs mem gz busy cpu load
1.0 Rust #2 1.30 111,692 721 4.69 99% 86% 86% 88%
1.0 Rust #4 1.36 155,852 756 4.93 87% 88% 99% 89%
1.0 Rust #3 1.36 119,808 754 4.97 89% 88% 99% 89%
1.2 C++ g++ #4 1.53 112,820 1270 4.03 99% 59% 52% 53%
1.5 C gcc #3 1.96 103,240 836 5.52 100% 65% 59% 58%
1.5 C gcc #2 1.97 168,724 809 5.66 63% 65% 99% 60%
1.5 Free Pascal #7 1.98 103,248 1003 4.93 49% 100% 58% 42%
1.5 Free Pascal #6 1.99 103,264 959 4.98 100% 58% 50% 42%
1.5 C++ g++ #9 2.00 104,788 809 5.61 89% 59% 57% 75%
1.5 Free Pascal #5 2.01 103,264 953 4.69 43% 42% 100% 50%
1.7 C++ g++ #6 2.22 221,636 844 5.92 68% 89% 48% 62%
1.7 C++ g++ #3 2.23 221,708 945 5.98 48% 63% 89% 68%
1.7 C# .NET Core #6 2.27 677,952 753 7.57 86% 81% 85% 83%
1.8 Rust 2.30 112,484 751 8.40 89% 88% 100% 88%
1.8 C++ g++ #8 2.35 221,596 820 6.28 74% 89% 58% 47%
1.9 Intel Fortran #2 2.43 111,884 1148 7.42 67% 70% 78% 90%
1.9 Java  #7 2.48 2,496,112 835 7.88 78% 91% 74% 75%
2.0 C++ g++ 2.66 1,804,720 754 9.36 86% 94% 85% 87%
2.1 F# .NET Core #5 2.67 575,900 635 9.04 87% 84% 84% 83%
2.3 Lisp SBCL #3 3.02 450,996 932 7.18 54% 78% 56% 50%
2.7 Ada 2012 GNAT #4 3.52 202,364 2107 11.52 76% 95% 81% 75%
3.1 F# .NET Core #8 4.02 764,624 769 13.53 82% 82% 86% 87%
3.1 OCaml #2 4.06 152,740 751 11.25 39% 73% 85% 80%
3.2 Erlang HiPE #2 4.14 435,300 478 12.08 74% 72% 81% 65%
3.3 Haskell GHC #7 4.34 522,348 811 16.37 94% 97% 94% 93%
3.7 Java #3 4.84 2,207,808 540 5.64 36% 18% 56% 7%
3.8 Java #6 4.90 1,730,116 529 5.72 39% 11% 37% 29%
3.8 Java #4 4.93 1,877,524 840 5.78 15% 20% 62% 21%
3.9 Java #2 5.03 1,731,532 552 5.82 49% 29% 8% 30%
3.9 C# .NET Core #3 5.11 1,578,896 676 16.33 84% 77% 79% 80%
4.1 Haskell GHC #6 5.30 469,260 592 19.26 88% 88% 90% 97%
4.5 Node js 5.83 1,204,544 711 19.61 86% 82% 84% 85%
4.8 F# .NET Core #7 6.22 1,504,008 516 16.63 61% 79% 64% 64%
4.9 Racket #4 6.39 983,176 853 16.18 78% 35% 43% 97%
5.6 Haskell GHC #3 7.25 635,384 538 26.99 96% 93% 95% 89%
5.6 Haskell GHC #5 7.29 697,596 561 27.01 91% 97% 92% 90%
6.0 Node js #6 7.76 1,264,168 744 23.00 70% 75% 73% 78%
6.1 Chapel #3 7.94 298,380 488 24.50 100% 77% 56% 75%
6.3 C gcc #5 8.26 351,308 908 30.00 82% 95% 93% 93%
6.9 Julia #4 9.02 602,872 372 27.77 78% 73% 72% 86%
7.0 Dart #4 9.12 679,628 1349 31.09 89% 83% 83% 86%
7.2 OCaml #5 9.41 154,616 461 9.46 100% 0% 0% 0%
7.5 Lisp SBCL 9.79 432,848 589 9.83 0% 0% 100% 0%
7.8 Erlang HiPE 10.14 542,588 420 10.40 21% 13% 68% 1%
9.5 Go #9 12.36 396,032 1007 43.05 88% 86% 89% 85%
9.5 Go #8 12.41 393,140 1017 43.13 86% 87% 89% 86%
9.6 Racket #3 12.51 594,092 473 12.54 0% 100% 0% 0%
10 Go #5 13.39 362,892 950 53.15 99% 99% 99% 99%
11 Go #3 13.70 370,656 799 53.27 97% 96% 97% 98%
11 Go #2 13.79 371,500 660 52.76 95% 94% 99% 95%
11 Go #4 13.80 364,744 654 53.07 95% 97% 97% 96%
11 Racket #2 13.86 595,656 416 13.90 0% 0% 100% 0%
11 Haskell GHC #2 14.21 455,036 491 26.66 29% 29% 29% 100%
11 Ada 2012 GNAT #3 14.24 528,208 1266 44.40 76% 77% 81% 77%
11 Dart 14.41 598,376 457 22.70 16% 22% 23% 97%
11 Haskell GHC 14.58 667,372 494 27.64 30% 30% 49% 81%
11 Dart #3 14.66 1,298,352 1206 54.89 94% 93% 94% 93%
12 Swift #3 15.93 701,592 862 50.78 79% 100% 65% 75%
12 Swift #2 15.97 701,496 816 50.45 78% 65% 74% 100%
13 VW Smalltalk #3 16.36 375,832 930 37.90 74% 71% 36% 50%
13 Julia #2 17.05 587,852 423 17.37 100% 1% 1% 1%
14 Swift #4 18.77 701,568 765 60.25 75% 67% 100% 79%
15 Swift 19.52 733,276 714 58.00 72% 95% 62% 69%
15 C gcc 19.73 263,652 654 19.85 83% 0% 0% 17%
16 C++ g++ #2 21.42 265,116 508 21.93 1% 0% 100% 2%
17 Ruby #5 22.43 368,032 1096 62.56 60% 61% 65% 93%
18 Ada 2012 GNAT 23.94 265,408 888 24.26 0% 1% 0% 100%
19 Racket 24.66 670,800 476 24.72 0% 0% 100% 0%
20 PHP #7 26.46 1,584,436 751 96.67 89% 90% 100% 87%
22 Intel Fortran 28.24 525,564 773 28.94 1% 100% 1% 0%
22 Go 28.73 253,248 482 49.85 48% 44% 47% 35%
22 Go #7 28.90 257,996 525 52.09 43% 47% 47% 43%
23 PHP #4 30.09 1,554,272 770 97.00 76% 83% 78% 86%
24 Node js #7 31.86 1,083,696 451 36.93 23% 31% 14% 48%
27 Go #6 35.29 355,328 611 36.53 98% 1% 2% 2%
29 VW Smalltalk 38.24 374,964 711 39.17 2% 0% 1% 100%
30 PHP #6 38.60 735,580 868 130.68 89% 79% 80% 91%
36 PHP #5 46.89 735,796 1040 124.68 83% 90% 8% 85%
37 Python 3 48.45 448,980 589 171.58 86% 86% 87% 94%
38 Lua #4 50.05 896,096 664 186.88 91% 93% 98% 92%
41 Ruby #4 53.95 559,712 364 55.07 100% 1% 1% 1%
57 Python 3 #3 74.56 677,492 1238 218.41 64% 93% 63% 72%
59 Perl #4 76.82 2,519,452 761 278.46 91% 87% 87% 97%
59 Ruby 76.82 559,628 376 77.94 1% 0% 100% 1%
59 Ruby #2 77.43 559,644 378 78.58 1% 0% 100% 0%
60 Ruby #3 78.64 635,408 400 79.80 59% 10% 1% 32%
64 PHP #3 83.68 1,557,328 428 84.05 0% 0% 100% 0%
66 Lua #3 86.15 896,196 684 173.22 48% 44% 54% 56%
71 PHP #2 92.93 743,780 423 93.47 0% 0% 94% 6%
75 PHP 97.32 743,760 451 97.84 100% 0% 0% 0%
81 Perl #3 105.33 2,200,764 648 5 min 74% 74% 92% 97%
111 Python 3 #2 143.90 274,448 338 144.92 100% 0% 0% 0%
111 Lua #2 144.35 960,080 412 145.64 1% 0% 0% 99%
193 Perl 250.89 599,468 395 252.50 0% 100% 0% 0%
239 Matz's Ruby #5 5 min 1,413,496 1096 16 min 71% 97% 76% 72%
432 Matz's Ruby #3 9 min 840,152 400 9 min 63% 37% 1% 1%
520 Matz's Ruby #4 11 min 1,558,916 364 11 min 14% 25% 22% 41%
579 Matz's Ruby 12 min 1,559,540 376 12 min 67% 0% 33% 0%
580 Matz's Ruby #2 12 min 1,558,956 378 12 min 0% 0% 100% 1%
Swift #9 Make Error