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