The Computer Language
25.02 Benchmarks Game

binary-trees

These are crowd sourced programs, contributed to the project by an ever-changing self-selected group.

We include both un-optimised programs and heavily optimised programs (look at the gz source code size). We include both single-thread programs and multi-thread programs (look at the cpu secs). We include [pdf] vector parallelism and even hand-written vector instructions. How the programs are written matters!

Always look at the source code.

 
 
  Here are the crowd sourced programs —  
× source secs mem gz cpu secs
1.0 Python 3 #2 100.49 281,829 344 100.42
1.1 Ruby #4 47.09 489,144 371 47.03
1.1 Julia #4 14.42 551,617 378 15.79
1.1 Ruby 48.14 487,592 383 48.08
1.1 Ruby #2 48.03 487,801 385 47.96
1.2 Julia #5 22.15 1,392,615 396 61.76
1.2 Perl 258.70 617,132 401 258.64
1.2 Ruby #3 49.67 523,936 407 49.60
1.2 Lua #2 141.62 982,589 418 141.56
1.2 Racket #2 9.20 385,794 422 9.15
1.2 Erlang 10.97 501,953 426 11.13
1.2 PHP #2 93.90 771,146 429 93.85
1.3 Julia #2 12.60 552,776 430 13.64
1.3 PHP #3 69.00 948,552 434 68.95
1.3 PHP 90.45 771,105 457 90.40
1.3 Node.js #7 15.99 1,076,969 458 28.03
1.4 OCaml #5 7.78 228,925 468 7.78
1.4 Python 3 #4 33.37 460,771 481 121.26
1.4 Racket 15.19 608,461 482 15.13
1.4 Erlang #2 5.08 500,834 485 13.56
1.4 Go 32.05 243,114 488 59.77
1.4 Dart aot #6 11.68 456,942 488 15.74
1.4 Chapel #4 7.29 495,673 489 26.57
1.4 Chapel #3 8.61 314,032 494 25.96
1.4 Haskell GHC #2 12.35 276,058 498 14.18
1.5 Haskell GHC 12.77 588,079 500 14.56
1.5 C++g++ #2 22.77 274,080 514 22.76
1.5 F# 14.36 938,693 517 14.94
1.5 F# #7 8.98 1,127,907 527 22.38
1.5 Go #7 32.57 241,345 531 61.36
1.6 Java naot #6 5.12 299,389 535 5.11
1.6 Haskell GHC #3 7.28 611,250 544 15.90
1.6 Java naot #3 4.85 290,574 546 4.85
1.6 Java naot #2 5.15 299,610 558 5.15
1.6 Haskell GHC #5 7.34 678,425 567 15.58
1.7 Lisp SBCL 9.60 665,092 595 9.58
1.7 Python 3 34.85 445,649 597 122.94
1.7 Haskell GHC #6 3.81 246,522 601 7.43
1.8 Go #6 27.93 416,195 618 29.26
1.9 Julia #3 7.34 569,876 640 19.99
1.9 Chapel #5 2.06 1,825,448 646 7.21
1.9 Perl #3 110.03 2,260,713 655 6 min
1.9 C gcc 21.21 272,065 660 21.21
1.9 C# naot 6.80 2,819,092 668 18.71
1.9 Python 3 #5 35.37 806,117 669 125.53
1.9 Lua #4 48.21 2,606,240 670 178.54
2.0 Go #2 14.21 635,613 672 56.53
2.0 Pharo Smalltalk 35.22 399,409 673 35.41
2.0 C# naot #3 6.71 2,829,128 688 17.67
2.0 Lua #3 82.77 1,783,443 690 166.61
2.1 C# naot #7 6.22 1,115,476 706 16.92
2.1 C# naot #2 6.22 1,018,946 717 17.10
2.1 Node.js 8.95 1,401,799 717 33.65
2.1 Swift 18.32 763,609 720 54.25
2.1 Rust #2 1.17 140,157 729 4.12
2.2 Node.js #6 8.54 1,278,456 752 30.84
2.2 OCaml #2 3.55 868,213 759 10.48
2.2 C++ g++ 2.69 1,896,727 760 9.42
2.2 Rust 2.10 137,417 760 7.44
2.2 Rust #3 1.40 172,392 762 5.05
2.2 Rust #4 1.38 202,686 765 4.95
2.2 PHP #7 22.24 1,316,532 767 81.13
2.2 Perl #4 77.36 2,587,648 769 281.04
2.2 Rust #5 1.07 139,121 771 3.72
2.2 Swift #4 17.69 733,131 772 56.13
2.3 Intel Fortran 32.74 540,066 780 32.73
2.3 PHP #4 24.74 1,280,827 786 81.41
2.3 Perl #6 39.22 782,742 800 144.71
2.3 Perl #5 50.17 1,078,489 805 185.46
2.3 Go #3 14.90 329,499 806 57.98
2.3 Haskell GHC #4 2.11 227,762 807 5.23
2.4 Swift #5 18.99 764,781 813 56.56
2.4 C++ g++ #9 1.76 140,571 815 4.65
2.4 C gcc #2 1.56 174,780 816 4.24
2.4 Haskell GHC #7 2.49 253,440 817 6.28
2.4 Swift #2 18.36 733,131 822 58.54
2.4 C++ g++ #4 2.22 273,977 826 5.23
2.4 Java naot #7 3.90 338,911 841 7.25
2.4 C gcc #3 1.96 138,711 842 4.72
2.5 Java naot #4 5.54 305,373 846 5.53
2.5 C++ g++ #6 1.93 273,973 851 4.77
2.5 Swift #3 18.24 733,000 868 58.81
2.5 Dart aot #7 10.56 679,973 869 23.61
2.5 PHP #6 38.32 2,379,801 877 130.85
2.6 C++ g++ #5 1.17 208,171 891 4.11
2.6 Ada 2012 GNAT 23.45 275,038 896 23.44
2.6 C++ g++ #7 1.01 175,108 896 3.44
2.7 C gcc #5 8.71 361,587 914 31.96
2.7 Lisp SBCL #3 2.83 641,151 938 7.18
2.8 C++ g++ #3 2.28 273,715 951 5.06
2.8 Go #5 14.68 386,056 957 58.09
2.8 Free Pascal #5 2.12 136,892 959 5.04
2.8 Free Pascal #6 2.12 136,897 967 5.05
2.9 Free Pascal #7 2.17 136,897 1010 5.15
3.0 Ruby #5 18.86 2,280,051 1016 53.80
3.0 Dart aot #5 12.49 487,326 1023 28.35
3.0 PHP #5 47.09 1,745,932 1048 124.38
3.4 Intel Fortran #2 2.24 148,124 1155 6.93
3.5 Dart aot #3 20.69 1,333,236 1219 52.15
3.6 Python 3 #3 51.88 819,077 1247 148.88
3.7 Ada 2012 GNAT #3 11.26 545,702 1275 37.28
4.1 Dart aot #4 10.80 592,011 1394 23.45
6.2 Ada 2012 GNAT #4 4.16 210,969 2117 12.10
C# naot #6 Empty
Swift #9 Empty
 
 
  * possible hand-written vector instructions or "unsafe"
 
× source secs mem gz cpu secs
1.4 * Racket #3 6.22 278,237 480 6.16
2.5 * Racket #4 4.81 471,519 861 9.30