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