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 Free Pascal #7 3.06 132,852 1003 10.34 100% 89% 70% 80%
1.0 Free Pascal #6 3.10 132,852 959 10.51 90% 88% 71% 91%
1.1 Free Pascal #5 3.31 132,740 953 10.63 89% 70% 71% 91%
1.1 Rust #2 3.31 199,852 721 12.01 88% 88% 87% 100%
1.2 C gcc #2 3.53 168,764 809 11.64 74% 99% 72% 85%
1.2 Rust #4 3.72 198,144 756 13.57 88% 99% 89% 89%
1.2 Rust #3 3.82 183,616 754 13.94 88% 100% 89% 88%
1.3 C gcc #3 3.88 113,940 836 12.56 86% 76% 78% 84%
1.3 C++ g++ #9 3.93 113,768 809 12.78 70% 81% 75% 98%
1.8 Fortran Intel #2 5.48 113,176 1148 15.91 63% 90% 75% 63%
1.9 C# .NET Core #6 5.74 842,220 753 20.31 92% 87% 84% 91%
1.9 C++ g++ #6 5.76 221,924 844 16.76 84% 40% 90% 78%
1.9 C++ g++ #3 5.78 221,804 945 16.74 39% 83% 77% 90%
2.0 F# .NET Core #5 6.16 735,984 635 22.23 92% 92% 88% 88%
2.1 C++ g++ #8 6.32 221,912 820 16.80 90% 65% 63% 47%
2.1 Rust 6.53 133,040 751 23.78 90% 88% 98% 88%
2.7 Erlang HiPE #2 8.18 464,444 478 24.76 87% 72% 72% 71%
2.7 Java  #7 8.32 953,620 835 28.37 95% 87% 81% 77%
2.7 Lisp SBCL #3 8.40 396,936 932 21.18 50% 58% 63% 81%
2.9 C++ g++ 8.90 2,049,812 754 32.94 92% 97% 91% 91%
3.0 Ada 2012 GNAT #4 9.25 202,428 2107 31.82 95% 81% 84% 84%
3.2 OCaml #2 9.89 152,952 751 29.31 68% 52% 91% 84%
3.5 Java #4 10.73 721,620 840 13.19 10% 34% 72% 8%
3.6 Java #3 11.05 783,408 540 14.24 74% 13% 11% 32%
3.7 Java #6 11.45 736,212 529 14.11 21% 8% 8% 86%
3.8 Java #2 11.55 779,968 552 14.65 12% 15% 90% 10%
4.2 Haskell GHC #6 12.96 476,448 592 47.98 92% 92% 93% 94%
4.8 Chapel #2 14.61 366,656 474 44.44 100% 74% 75% 56%
5.1 C# .NET Core #3 15.59 1,889,664 676 53.34 87% 88% 84% 83%
5.1 F# .NET Core #7 15.65 1,594,380 516 51.22 88% 81% 79% 79%
5.3 Haskell GHC #5 16.12 687,556 561 59.86 92% 91% 93% 95%
5.5 Racket #4 16.93 984,544 853 46.33 93% 57% 69% 55%
5.7 Dart #4 17.29 813,492 1349 43.83 80% 66% 53% 55%
5.7 Haskell GHC #3 17.57 694,596 538 66.23 95% 93% 93% 96%
6.0 C gcc #5 18.32 351,420 908 65.43 89% 85% 90% 93%
6.1 C# .NET Core #2 18.53 714,208 586 21.85 19% 49% 38% 12%
6.9 Julia #4 21.19 645,680 372 66.24 74% 74% 77% 88%
7.1 OCaml #5 21.79 173,924 461 21.98 40% 1% 0% 60%
7.1 Node js #6 21.79 1,045,424 744 77.02 87% 91% 88% 88%
7.3 TypeScript #4 22.40 1,062,228 948 79.48 88% 92% 87% 88%
7.4 F# .NET Core #3 22.58 856,672 531 26.13 19% 48% 40% 8%
7.8 Haskell GHC 24.01 667,252 494 48.31 33% 59% 75% 33%
8.0 Erlang HiPE 24.55 604,012 420 25.63 87% 3% 3% 12%
8.0 Ada 2012 GNAT #3 24.56 528,312 1266 82.94 84% 82% 82% 89%
8.3 Dart 25.48 797,004 457 29.62 78% 11% 11% 16%
8.6 Go #9 26.46 572,836 1007 89.76 86% 84% 85% 85%
8.7 Lisp SBCL 26.60 531,428 589 26.82 0% 0% 100% 1%
8.8 Go #5 27.04 468,452 950 106.48 99% 99% 98% 99%
9.0 Node js #5 27.54 936,268 994 98.54 88% 89% 92% 89%
9.0 Go #4 27.56 498,500 654 105.58 95% 98% 95% 95%
9.1 Go #2 27.79 479,176 660 106.20 96% 95% 96% 96%
9.2 C# .NET Core 28.02 1,256,752 600 34.29 25% 41% 44% 12%
9.2 Racket #3 28.19 513,728 473 28.52 0% 100% 1% 0%
9.3 Node js #4 28.48 595,292 1008 102.78 89% 91% 91% 90%
9.5 Dart #3 29.00 1,662,480 1206 94.10 82% 82% 79% 82%
9.5 Haskell GHC #2 29.04 455,264 491 60.60 36% 78% 59% 36%
9.5 F# .NET Core 29.06 1,203,940 506 35.05 42% 32% 34% 13%
9.7 Racket #2 29.61 506,624 416 29.85 0% 64% 36% 1%
10 F# .NET Core #4 31.93 1,219,884 488 37.34 29% 34% 37% 17%
11 VW Smalltalk #3 32.47 376,016 930 81.92 61% 89% 34% 68%
12 Julia #2 37.08 582,548 423 38.00 100% 1% 1% 1%
12 Swift #2 37.86 702,792 816 119.21 100% 76% 78% 60%
13 C++ g++ #2 38.33 265,060 508 38.97 36% 1% 1% 64%
13 C gcc 39.72 263,676 654 40.16 100% 0% 1% 0%
13 F# .NET Core #2 40.26 1,394,576 482 46.46 34% 34% 32% 16%
14 Ada 2012 GNAT 42.44 265,420 888 43.87 37% 1% 2% 63%
14 Swift #4 43.58 702,676 765 138.07 100% 74% 70% 73%
14 TypeScript #2 44.32 707,488 456 100.51 71% 55% 52% 49%
15 Ruby #5 44.61 531,600 1096 125.16 67% 72% 60% 81%
15 Node js #3 44.89 704,240 434 100.14 63% 61% 48% 50%
15 TypeScript 44.93 710,220 460 100.00 53% 49% 57% 64%
15 Swift 45.21 733,820 714 135.67 93% 69% 70% 68%
15 Node js 46.27 715,020 440 103.11 64% 56% 50% 52%
16 Racket 48.16 658,956 476 48.94 70% 1% 1% 30%
17 PHP #7 50.59 1,584,444 751 182.39 87% 86% 99% 90%
18 Go 56.45 250,400 482 102.27 48% 41% 47% 45%
18 PHP #6 56.49 754,960 868 208.74 91% 91% 90% 97%
19 Go #7 57.98 258,268 525 105.76 46% 46% 45% 47%
20 Fortran Intel 60.82 525,628 773 61.46 6% 47% 48% 1%
20 PHP #4 62.16 1,554,328 770 193.52 74% 71% 71% 94%
24 PHP #5 73.79 733,236 1040 208.73 84% 93% 59% 48%
25 VW Smalltalk 75.50 375,636 711 76.22 0% 0% 100% 1%
25 Go #6 77.05 372,144 611 79.75 3% 26% 74% 1%
26 Python 3 80.30 448,004 589 286.50 95% 87% 87% 88%
37 Ruby #4 112.63 577,948 364 114.72 62% 0% 1% 39%
37 Python 3 #3 113.34 677,608 1238 5 min 72% 61% 93% 64%
48 Ruby 148.19 577,892 376 151.33 1% 97% 4% 1%
49 Ruby #2 148.53 577,904 378 153.43 68% 2% 1% 33%
49 Ruby #3 149.94 449,240 400 153.65 23% 22% 42% 16%
50 PHP #3 153.58 1,557,200 428 156.36 12% 0% 72% 17%
55 PHP 168.54 738,472 451 172.02 16% 0% 0% 85%
56 Perl #3 172.50 2,200,640 648 9 min 72% 87% 73% 100%
60 PHP #2 182.03 743,760 423 186.16 3% 1% 98% 1%
83 Python 3 #2 254.66 274,564 338 258.71 80% 0% 0% 20%
137 Perl 6 min 599,248 395 7 min 99% 0% 1% 1%
153 Lua #2 7 min 2,358,616 412 7 min 1% 1% 100% 0%
415 Matz's Ruby #3 21 min 839,888 400 21 min 60% 0% 40% 0%
566 Matz's Ruby #4 28 min 1,558,556 364 29 min 100% 0% 1% 0%
598 Matz's Ruby #2 30 min 1,558,496 378 30 min 11% 1% 1% 88%
600 Matz's Ruby 30 min 1,558,448 376 30 min 77% 1% 1% 24%
Haskell GHC #4 Bad Output
Matz's Ruby #5 Failed
Swift #9 Bad Output