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.4 Rust #4 1.38 202,686 765 4.95
1.4 Rust #3 1.40 172,392 762 5.05
1.5 C gcc #2 1.56 174,780 816 4.24
1.7 C++ g++ #9 1.76 140,571 815 4.65
1.9 C++ g++ #6 1.93 273,973 851 4.77
1.9 C gcc #3 1.96 138,711 842 4.72
2.1 Chapel #5 2.09 1,825,436 646 7.30
2.1 Rust 2.10 137,417 760 7.44
2.1 Free Pascal #5 2.12 136,892 959 5.04
2.1 Free Pascal #6 2.12 136,897 967 5.05
2.1 Haskell GHC #4 2.16 227,852 807 5.32
2.2 Free Pascal #7 2.17 136,897 1010 5.15
2.2 C++ g++ #4 2.22 273,977 826 5.23
2.2 Intel Fortran #2 2.24 148,124 1155 6.93
2.3 C++ g++ #3 2.28 273,715 951 5.06
2.6 Haskell GHC #7 2.66 237,572 817 6.72
2.7 C++ g++ 2.69 1,896,727 760 9.42
2.8 Lisp SBCL #3 2.83 641,151 938 7.18
3.5 OCaml #2 3.55 868,213 759 10.48
3.9 Java naot #7 3.90 338,911 841 7.25
3.9 Haskell GHC #6 3.92 246,542 601 7.63
4.1 Ada 2012 GNAT #4 4.16 210,969 2117 12.10
4.8 Java naot #3 4.85 290,574 546 4.85
5.0 Erlang #2 5.08 500,834 485 13.56
5.1 Java naot #6 5.12 299,389 535 5.11
5.1 Java naot #2 5.15 299,610 558 5.15
5.5 Java naot #4 5.54 305,373 846 5.53
6.2 C# naot #2 6.22 1,018,946 717 17.10
6.2 C# naot #7 6.22 1,115,476 706 16.92
6.7 C# naot #3 6.71 2,829,128 688 17.67
6.8 C# naot 6.80 2,819,092 668 18.71
6.9 Haskell GHC #3 6.97 697,176 544 15.86
7.2 Haskell GHC #5 7.22 684,757 567 15.49
7.2 Chapel #4 7.29 495,682 489 26.60
7.4 Julia #3 7.40 564,216 640 19.51
7.7 OCaml #5 7.78 228,925 468 7.78
8.5 Node.js #6 8.61 1,275,720 752 31.10
8.6 Chapel #3 8.63 313,868 494 25.90
8.6 C gcc #5 8.71 361,587 914 31.96
8.9 Node.js 8.94 1,389,228 717 33.88
8.9 F# #7 8.98 1,127,907 527 22.38
9.1 Racket #2 9.20 385,794 422 9.15
9.5 Dart aot #7 9.57 635,625 869 23.66
9.5 Lisp SBCL 9.60 665,092 595 9.58
10 Dart aot #4 10.24 692,199 1394 24.21
11 Erlang 10.97 501,953 426 11.13
11 Ada 2012 GNAT #3 11.26 545,702 1275 37.28
12 Dart aot #6 11.72 474,780 488 16.18
12 Dart aot #5 12.17 524,239 1023 29.92
12 Haskell GHC 12.58 702,763 500 14.29
13 Julia #2 12.65 552,669 430 13.72
13 Haskell GHC #2 12.84 274,993 498 14.62
14 Go #2 14.21 635,613 672 56.53
14 F# 14.36 938,693 517 14.94
14 Julia #4 14.42 550,064 378 15.75
15 Go #5 14.68 386,056 957 58.09
15 Go #3 14.90 329,499 806 57.98
15 Racket 15.19 608,461 482 15.13
16 Node.js #7 16.07 1,128,059 458 28.42
17 Dart aot #3 17.52 4,337,738 1219 54.09
18 Swift #4 17.62 733,094 772 55.85
18 Swift 18.21 763,523 720 54.00
18 Swift #2 18.24 732,828 822 58.93
18 Swift #3 18.26 733,180 868 58.19
19 Ruby #5 18.86 2,280,051 1016 53.80
19 Swift #5 18.90 764,391 813 56.23
21 C gcc 21.21 272,065 660 21.21
22 Julia #5 21.83 1,336,107 396 61.36
22 PHP #7 22.24 1,316,532 767 81.13
23 C++ g++ #2 22.77 274,080 514 22.76
23 Ada 2012 GNAT 23.45 275,038 896 23.44
25 PHP #4 24.74 1,280,827 786 81.41
28 Go #6 27.93 416,195 618 29.26
32 Go 32.05 243,114 488 59.77
32 Go #7 32.57 241,345 531 61.36
33 Intel Fortran 32.74 540,066 780 32.73
33 Python 3 #4 33.37 460,771 481 121.26
35 Python 3 34.85 445,649 597 122.94
35 Pharo Smalltalk 35.22 399,409 673 35.41
35 Python 3 #5 35.37 806,117 669 125.53
38 PHP #6 38.32 2,379,801 877 130.85
39 Perl #6 39.22 782,742 800 144.71
47 PHP #5 47.09 1,745,932 1048 124.38
47 Ruby #4 47.09 489,144 371 47.03
48 Ruby #2 48.03 487,801 385 47.96
48 Ruby 48.14 487,592 383 48.08
48 Lua #4 48.21 2,606,240 670 178.54
49 Ruby #3 49.67 523,936 407 49.60
50 Perl #5 50.17 1,078,489 805 185.46
52 Python 3 #3 51.88 819,077 1247 148.88
69 PHP #3 69.00 948,552 434 68.95
77 Perl #4 77.36 2,587,648 769 281.04
82 Lua #3 82.77 1,783,443 690 166.61
90 PHP 90.45 771,105 457 90.40
93 PHP #2 93.90 771,146 429 93.85
100 Python 3 #2 100.49 281,829 344 100.42
109 Perl #3 110.03 2,260,713 655 6 min
141 Lua #2 141.62 982,589 418 141.56
257 Perl 258.70 617,132 401 258.64
C# naot #6 Empty
Swift #9 Empty
 
 
  * possible hand-written vector instructions or "unsafe"
 
× source secs mem gz cpu secs
4.8 * Racket #4 4.81 471,519 861 9.30
6.2 * Racket #3 6.22 278,237 480 6.16