The Computer Language
24.11 Benchmarks Game

binary-trees

First, here are a few naive un-optimised single-thread #8 programs transliterated lowest-common-denominator style into different programming languages from the same original —

  source secs mem gz    
  Java #8 6.57 1,767,108 596    
  C# .NET #8 13.50 883,524 601    
  Dart #8 14.10 432,452 536    
  Intel C #8 19.46 285,952 607    
  C clang #8 19.63 285,536 607    
  C gcc #8 21.08 285,544 607    
  Node.js #8 19.86 1,334,104 521    
  Swift #8 54.90 402,048 567    
  PHP #8 92.50 750,592 590    
  Java -Xint #8 94.28 1,163,864 596    
  Ruby yjit #8 130.97 478,720 494    
  Python 3 #8 9 min 798,336 535    
 
 
  Here are the crowd sourced programs —  
 
 
× source secs mem gz cpu secs cpu load
1.0 C++ g++ #7 0.97 201,512 896 3.40 84% 99% 84% 84%
1.1 Rust #5 1.08 198,656 771 3.77 84% 99% 83% 85%
1.2 C++ g++ #5 1.16 200,724 891 4.10 86% 98% 87% 86%
1.2 C gcc #2 1.53 169,284 816 4.18 99% 66% 57% 52%
1.3 Rust #2 1.22 199,684 729 4.29 85% 86% 85% 98%
1.4 C++ g++ #9 1.74 136,120 815 4.63 63% 54% 100% 50%
1.4 C gcc #3 1.96 134,540 842 4.70 53% 43% 100% 44%
1.4 C++ g++ #3 1.91 265,636 951 4.74 76% 41% 86% 45%
1.4 C++ g++ #6 1.91 266,120 851 4.77 47% 87% 53% 63%
1.4 Rust #4 1.33 187,948 765 4.80 88% 88% 99% 88%
1.5 Free Pascal #5 2.10 132,608 959 5.00 54% 100% 47% 39%
1.5 Free Pascal #6 2.10 132,608 967 5.03 100% 54% 39% 47%
1.5 Rust #3 1.40 188,740 762 5.06 89% 87% 99% 87%
1.5 Java  #4 4.41 1,821,244 846 5.14 11% 6% 52% 46%
1.5 Free Pascal #7 2.15 132,608 1010 5.15 99% 41% 45% 54%
1.5 C++ g++ #4 2.22 266,136 826 5.20 33% 61% 52% 87%
1.5 Haskell GHC #4 2.06 271,032 807 5.24 63% 60% 58% 72%
1.7 Java #6 4.87 1,782,568 535 5.63 13% 39% 54% 9%
1.7 Java #3 4.85 1,769,500 546 5.65 8% 75% 5% 27%
1.7 Java #2 5.09 1,820,068 558 5.83 8% 19% 8% 78%
1.8 Haskell GHC #7 2.39 262,800 817 6.02 61% 70% 65% 56%
2.0 Intel Fortran #2 2.22 140,544 1155 6.86 85% 67% 68% 90%
2.1 Rust 2.05 132,992 760 7.21 83% 96% 86% 87%
2.1 Chapel #5 2.04 1,775,616 646 7.28 95% 86% 86% 92%
2.1 Java #8 6.57 1,767,108 596 7.29 7% 17% 28% 60%
2.2 Lisp SBCL #3 3.00 660,620 938 7.41 58% 84% 61% 45%
2.3 Haskell GHC #6 4.06 236,896 601 7.72 44% 42% 56% 49%
2.3 OCaml #5 7.80 221,952 468 7.80 0% 0% 1% 100%
2.4 Java #7 2.62 1,803,192 841 8.14 84% 74% 75% 78%
2.7 Racket #2 9.11 327,096 422 9.11 0% 100% 0% 0%
2.7 C++ g++ 2.65 2,153,044 760 9.23 85% 95% 85% 86%
2.8 Lisp SBCL 9.57 643,680 595 9.57 0% 100% 0% 0%
3.0 OCaml #2 3.59 216,628 759 10.35 43% 76% 84% 85%
3.3 Erlang 10.90 482,520 426 11.11 7% 61% 33% 1%
3.3 Julia #4 10.32 443,600 378 11.22 5% 99% 3% 1%
3.7 Julia #2 11.38 441,140 430 12.44 1% 98% 0% 9%
3.8 Erlang #2 4.81 478,992 485 13.06 90% 62% 71% 74%
4.0 F# .NET 11.60 1,036,652 517 13.72 15% 61% 27% 19%
4.1 Haskell GHC #2 12.13 264,704 498 13.80 31% 60% 17% 6%
4.2 Haskell GHC 12.68 671,616 500 14.44 9% 13% 77% 14%
4.4 Racket 15.10 543,632 482 15.09 0% 99% 0% 0%
4.5 C# .NET #8 13.50 883,524 601 15.31 8% 31% 41% 33%
4.6 Haskell GHC #5 7.37 671,276 567 15.63 48% 53% 70% 40%
4.7 Dart #6 11.70 445,528 488 15.84 46% 21% 15% 53%
4.7 Haskell GHC #3 6.96 682,624 544 15.87 55% 64% 51% 57%
5.1 C# .NET #7 5.34 1,074,228 706 17.42 81% 78% 81% 87%
5.2 C# .NET #2 5.37 1,083,480 717 17.60 83% 79% 89% 77%
5.5 Dart #8 14.10 432,452 536 18.56 58% 16% 11% 45%
5.7 Julia #3 7.08 486,976 640 19.44 78% 73% 57% 67%
5.9 C# .NET 6.11 3,178,448 668 19.93 85% 77% 79% 91%
6.0 C# .NET #3 6.45 2,900,008 688 20.33 82% 76% 80% 77%
6.2 C gcc #8 21.08 285,544 607 21.08 62% 0% 38% 0%
6.4 F# .NET #7 7.58 988,852 527 21.64 72% 72% 70% 72%
6.4 C gcc 21.67 264,244 660 21.67 47% 18% 0% 34%
6.7 C++ g++ #2 22.83 265,840 514 22.82 70% 0% 0% 30%
6.9 Ada 2012 GNAT 23.45 266,316 896 23.45 43% 23% 0% 33%
7.2 Dart #4 11.56 562,668 1394 24.55 59% 46% 52% 55%
7.3 Dart #7 10.93 674,712 869 24.84 60% 58% 50% 59%
7.5 Chapel #3 8.47 300,672 494 25.56 99% 74% 56% 72%
7.7 Chapel #4 7.11 477,824 489 26.09 99% 89% 89% 90%
8.3 Node.js #7 16.02 1,070,260 458 28.26 41% 39% 61% 34%
8.5 Dart #5 12.60 474,784 1023 28.93 55% 56% 61% 58%
8.6 Go #6 27.90 404,096 618 29.26 74% 4% 23% 2%
9.0 Node.js #6 8.60 1,250,816 752 30.68 90% 88% 87% 91%
9.4 C gcc #5 8.77 351,332 914 31.93 92% 91% 88% 91%
9.6 Intel Fortran 32.59 525,824 780 32.59 100% 0% 0% 0%
9.6 Node.js #8 19.86 1,334,104 521 32.74 45% 32% 54% 33%
9.9 Node.js 8.92 1,405,276 717 33.60 95% 94% 93% 94%
11 Ada 2012 GNAT #3 11.30 529,436 1275 37.09 80% 81% 87% 80%
11 VW Smalltalk 37.93 375,552 717 37.93 2% 97% 0% 0%
11 VW Smalltalk #3 16.93 375,808 932 38.02 50% 62% 82% 30%
14 PHP #3 46.07 921,600 434 46.07 3% 96% 0% 0%
14 Ruby yjit #4 47.23 478,464 371 47.22 97% 0% 2% 0%
14 Ruby yjit 48.86 478,592 383 48.85 100% 0% 0% 0%
14 Ruby yjit #2 48.90 524,800 385 48.89 43% 0% 56% 0%
15 Ruby yjit #3 49.82 517,080 407 49.81 100% 0% 0% 0%
16 Dart #3 21.25 5,400,800 1219 53.12 61% 63% 59% 68%
16 Ruby yjit #5 19.08 521,972 1016 54.19 98% 61% 61% 64%
16 Swift 18.28 737,152 720 54.20 94% 61% 68% 72%
16 Swift #8 54.90 402,048 567 54.89 0% 100% 0% 0%
16 Swift #4 17.49 707,456 772 55.84 65% 99% 75% 79%
16 PHP #7 15.58 948,608 767 56.00 88% 89% 93% 89%
17 Swift #5 18.89 738,048 813 56.25 74% 60% 94% 70%
17 Go #2 14.17 624,780 672 56.29 99% 99% 99% 99%
17 PHP #4 18.34 918,528 786 56.94 73% 82% 70% 85%
17 Julia #5 17.97 482,024 396 57.53 74% 84% 85% 77%
17 Go #3 14.91 326,508 806 58.00 98% 96% 98% 96%
17 Go #5 14.87 425,960 957 58.15 98% 98% 97% 98%
17 Swift #2 18.29 707,456 822 58.16 99% 63% 79% 76%
17 Swift #3 18.18 707,584 868 58.24 99% 64% 79% 77%
18 Go 32.01 243,192 488 59.78 45% 50% 46% 44%
18 Go #7 32.52 248,604 531 61.47 45% 50% 51% 43%
18 PHP 61.97 748,788 457 61.97 13% 86% 0% 0%
19 PHP #2 63.25 748,792 429 63.24 0% 100% 0% 0%
25 PHP #5 33.17 805,512 1048 84.83 24% 77% 86% 68%
27 PHP #6 27.48 805,532 877 91.38 79% 89% 87% 77%
27 PHP #8 92.50 750,592 590 92.49 0% 100% 0% 0%
30 Python 3 #2 100.90 271,872 344 100.89 98% 0% 0% 1%
36 Python 3 #4 33.61 276,992 481 121.96 93% 88% 89% 93%
37 Python 3 #5 35.49 274,816 669 126.17 95% 89% 88% 82%
38 Python 3 36.12 276,992 597 127.68 87% 95% 86% 85%
38 Ruby yjit #8 130.97 478,720 494 130.95 3% 96% 0% 0%
42 Lua #2 141.55 956,672 418 141.52 100% 0% 0% 0%
44 Perl #6 40.21 760,192 800 148.50 90% 90% 99% 90%
44 Python 3 #3 52.28 671,872 1247 149.07 89% 64% 59% 71%
49 Lua #3 83.71 809,856 690 167.26 59% 47% 40% 52%
53 Lua #4 48.65 956,672 670 180.27 97% 91% 91% 91%
56 Perl #5 52.18 1,048,704 805 189.88 87% 100% 88% 88%
78 Perl 263.97 599,424 401 263.95 0% 96% 3% 0%
85 Perl #4 79.54 2,519,560 769 287.74 88% 95% 88% 89%
110 Perl #3 110.37 2,200,700 655 6 min 74% 93% 73% 98%
164 Python 3 #8 9 min 798,336 535 9 min 8% 91% 0% 0%
174 Matz's Ruby #3 9 min 840,268 407 9 min 100% 0% 0% 0%
213 Matz's Ruby #4 12 min 1,559,040 371 12 min 96% 3% 0% 0%
232 Matz's Ruby 13 min 1,558,912 383 13 min 25% 0% 0% 74%
232 Matz's Ruby #2 13 min 1,559,040 385 13 min 94% 1% 0% 4%
313 Matz's Ruby #5 5 min 1,559,164 1016 17 min 74% 73% 96% 72%
Ada 2012 GNAT #4 Failed
C# .NET #6 Make Error
Matz's Ruby #8 Timed Out
Swift #9 Make Error
 
 
  * possible hand-written vector instructions | "unsafe"
 
× source secs mem gz cpu secs cpu load
1.8 * Racket #3 6.14 223,504 480 6.14 0% 0% 100% 0%
2.8 * Racket #4 5.00 418,536 861 9.56 56% 43% 51% 42%