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 C++ g++ #5 1.16 200,288 890 4.19 89% 88% 87% 98%
1.0 Rust #2 1.20 200,160 721 4.27 87% 86% 86% 98%
1.1 Rust #4 1.22 174,480 756 4.40 98% 87% 88% 88%
1.1 Rust #3 1.29 179,812 754 4.68 88% 88% 98% 88%
1.3 C++ g++ #4 1.53 134,352 1270 3.99 50% 99% 51% 61%
1.7 C gcc #3 1.97 134,432 836 5.58 59% 66% 59% 100%
1.7 C gcc #2 1.98 168,692 809 5.63 60% 100% 64% 61%
1.7 Free Pascal #7 1.99 132,740 1003 4.95 49% 58% 100% 42%
1.7 Free Pascal #6 2.00 132,776 959 4.96 42% 49% 58% 100%
1.7 Free Pascal #5 2.01 130,924 953 4.73 42% 100% 50% 43%
1.7 C++ g++ #9 2.01 135,720 809 5.59 58% 57% 63% 100%
1.9 C++ g++ #6 2.23 265,556 844 5.85 89% 48% 65% 60%
1.9 C++ g++ #3 2.23 265,344 945 5.87 66% 61% 90% 47%
1.9 C# .NET Core #6 2.26 781,936 753 7.48 78% 77% 87% 90%
2.0 C++ g++ #8 2.34 265,616 820 6.14 65% 89% 62% 46%
2.0 Rust 2.35 132,916 751 8.34 98% 89% 83% 83%
2.1 Intel Fortran #2 2.43 133,432 1148 7.37 67% 66% 90% 79%
2.1 Java  #7 2.49 2,490,296 835 7.88 92% 75% 78% 72%
2.3 C++ g++ 2.69 1,813,468 754 9.38 86% 86% 93% 84%
2.3 F# .NET Core #5 2.71 697,592 635 9.30 89% 88% 82% 84%
3.0 Ada 2012 GNAT #4 3.51 202,356 2107 11.72 85% 80% 76% 94%
3.3 F# .NET Core #8 3.87 730,748 769 13.36 85% 85% 89% 86%
3.5 OCaml #2 4.06 152,700 751 11.16 55% 54% 84% 82%
3.6 Erlang HiPE #2 4.12 460,684 478 12.01 77% 66% 75% 73%
3.6 Java #4 4.13 2,050,308 840 4.99 38% 8% 61% 13%
3.7 Haskell GHC #8 4.34 471,032 799 15.56 96% 88% 87% 87%
3.9 Java #3 4.57 1,899,060 540 5.52 38% 14% 25% 44%
4.0 Java #6 4.60 1,706,268 529 5.43 23% 78% 7% 10%
4.1 Haskell GHC #7 4.70 524,352 811 17.74 93% 93% 94% 97%
4.1 Java #2 4.74 1,692,372 552 5.53 23% 8% 78% 8%
4.2 Lisp SBCL #3 4.85 327,456 932 9.11 40% 48% 63% 36%
4.4 Haskell GHC #6 5.10 458,692 592 18.51 89% 87% 91% 96%
4.4 C# .NET Core #3 5.11 1,832,504 676 16.40 83% 80% 83% 76%
5.0 Node js 5.75 1,221,440 711 19.16 81% 88% 84% 80%
5.4 F# .NET Core #7 6.25 1,552,588 516 16.96 63% 64% 77% 68%
5.7 Node js #6 6.56 1,249,532 744 20.09 72% 87% 76% 71%
5.9 Racket #4 6.81 994,184 853 16.92 38% 75% 54% 81%
6.2 Haskell GHC #3 7.18 637,228 538 26.52 93% 87% 93% 96%
6.3 Haskell GHC #5 7.25 693,420 561 26.85 89% 91% 97% 94%
6.9 Chapel #3 7.93 298,556 488 24.49 100% 56% 77% 75%
6.9 C gcc #5 8.01 351,408 908 29.59 92% 93% 94% 91%
7.6 Julia #5 8.78 597,140 390 28.37 77% 79% 90% 78%
7.9 Dart #4 9.19 670,444 1349 31.02 88% 89% 82% 78%
8.1 OCaml #5 9.39 154,572 461 9.40 0% 100% 0% 0%
8.3 Julia #4 9.56 604,600 372 29.89 85% 82% 73% 73%
8.8 Erlang HiPE 10.16 602,176 420 10.40 1% 80% 1% 21%
10 Lisp SBCL 11.49 374,952 589 11.94 0% 3% 100% 1%
11 Racket #3 12.46 592,448 473 12.50 100% 0% 0% 0%
11 Go #8 12.57 352,428 1017 43.46 89% 87% 85% 85%
11 Go #9 12.64 394,156 1007 43.67 86% 85% 86% 88%
12 Go #5 13.38 336,676 950 53.01 99% 99% 99% 99%
12 Go #3 13.88 364,456 799 54.11 97% 97% 98% 98%
12 Racket #2 13.90 594,996 416 14.00 100% 0% 0% 0%
12 Go #2 13.96 382,256 660 53.50 97% 95% 95% 96%
12 Go #4 14.03 362,104 654 53.89 96% 95% 96% 97%
12 Haskell GHC #2 14.25 453,140 491 26.39 30% 100% 26% 29%
12 Ada 2012 GNAT #3 14.27 528,188 1266 44.18 77% 76% 81% 75%
12 Dart 14.31 598,660 457 22.79 97% 27% 16% 19%
12 Haskell GHC 14.41 667,360 494 27.19 29% 30% 30% 100%
13 Dart #3 15.09 1,326,116 1206 55.25 93% 91% 91% 92%
14 Swift #3 15.78 701,464 862 50.96 100% 75% 80% 67%
14 Swift #2 15.86 701,548 816 50.84 100% 67% 79% 75%
14 VW Smalltalk #3 16.51 376,500 930 37.41 71% 77% 48% 30%
16 Swift #4 18.74 701,680 765 60.27 67% 79% 76% 100%
17 Julia #2 19.42 702,968 423 24.82 96% 13% 9% 9%
17 Swift 19.52 733,268 714 58.19 72% 95% 68% 63%
17 C gcc 19.82 263,612 654 20.42 100% 2% 0% 1%
19 C++ g++ #2 21.43 265,136 508 21.51 0% 0% 0% 100%
19 Ruby #5 22.04 531,952 1096 62.37 68% 89% 64% 62%
21 Ada 2012 GNAT 23.85 265,280 888 24.12 9% 57% 35% 0%
21 Racket 24.73 669,924 476 25.36 100% 2% 0% 0%
23 PHP #7 26.46 1,584,464 751 96.13 85% 97% 91% 90%
25 Go #7 28.69 267,940 525 53.51 52% 41% 48% 46%
25 Go 28.95 245,676 482 51.94 44% 43% 48% 45%
26 Intel Fortran 29.70 525,568 773 30.01 1% 0% 0% 100%
26 PHP #4 30.06 1,554,400 770 96.90 77% 77% 97% 72%
28 Node js #7 31.95 1,077,892 451 36.96 19% 30% 28% 39%
29 Go 33.63 633,364 689 131.28 97% 98% 98% 97%
31 Go #6 35.62 407,780 611 37.34 99% 2% 1% 3%
33 VW Smalltalk 37.68 375,504 711 38.70 2% 100% 0% 1%
33 PHP #6 38.59 760,596 868 130.69 89% 80% 89% 81%
41 PHP #5 47.38 738,676 1040 126.00 10% 89% 83% 83%
42 Python 3 48.39 278,240 589 171.39 87% 88% 94% 86%
44 Lua #4 51.36 884,420 664 190.60 92% 98% 90% 91%
47 Ruby #4 54.89 546,148 364 56.11 0% 100% 1% 1%
65 Python 3 #3 75.43 677,724 1238 221.08 64% 94% 64% 72%
67 Ruby 77.23 546,108 376 78.57 1% 100% 0% 1%
67 Ruby #2 77.38 546,152 378 78.89 31% 0% 23% 48%
69 Ruby #3 79.34 425,124 400 80.66 100% 1% 0% 0%
72 PHP #3 83.67 1,557,296 428 84.27 0% 100% 1% 0%
73 Perl #4 84.89 2,519,528 761 5 min 98% 91% 88% 88%
73 Lua #3 84.97 884,428 684 169.96 53% 31% 58% 59%
80 PHP #2 92.96 743,788 423 93.83 0% 0% 0% 100%
84 PHP 97.24 743,772 451 98.11 0% 100% 0% 0%
101 Perl #3 117.01 2,203,532 648 6 min 93% 91% 80% 75%
122 Python 3 #2 140.70 274,216 338 141.97 0% 0% 0% 100%
128 Lua #2 147.67 938,072 412 149.06 0% 0% 100% 0%
219 Perl 253.03 599,568 395 260.57 1% 100% 1% 1%
268 Matz's Ruby #5 5 min 1,413,528 1096 16 min 72% 73% 71% 100%
487 Matz's Ruby #3 9 min 840,252 400 9 min 0% 4% 0% 96%
594 Matz's Ruby #4 11 min 1,558,880 364 11 min 4% 8% 0% 89%
653 Matz's Ruby 12 min 1,559,832 376 12 min 0% 38% 0% 63%
662 Matz's Ruby #2 12 min 1,559,532 378 12 min 0% 0% 0% 100%
Swift #9 Make Error