The Computer Language
25.02 Benchmarks Game

pidigits

Always look at the source code.

(Lumpers and Splitters.)

Some of these programs are single-thread and some are multi-thread: compare "secs" and "cpu secs". Some of these programs are un-optimised and some are heavily optimised: sort-by "gz" source code size.

Some of these programs are "naked ffi" and some put that in a library. Some of these programs are high-level and some are hand-written vector instructions.

Always look at the source code.

  * possible hand-written vector instructions or "unsafe" or naked ffi
 
× source secs mem gz cpu secs
1.0 Rust #4 0.71 4,055 804 0.71
1.0 C++g++ #4 0.72 6,496 521 0.71
1.0 * C++ g++ #5 0.73 6,300 804 0.73
1.0 C gcc #2 0.74 4,006 422 0.73
1.0 Intel Fortran #4 0.74 6,590 987 0.74
1.0 * Ada 2012 GNAT #2 0.75 7,373 1137 0.74
1.0 * Free Pascal #3 0.75 3,195 536 0.74
1.0 * Rust #2 0.75 4,387 1312 0.74
1.0 C gcc 0.75 3,727 459 0.74
1.0 * Rust 0.75 4,243 1426 0.74
1.0 * Rust #3 0.75 4,510 1373 0.75
1.1 * C# naot #6 0.75 7,905 1182 0.74
1.1 * Swift #2 0.76 14,459 606 0.75
1.1 Chapel #2 0.79 11,690 423 0.77
1.1 * Chapel #4 0.80 11,600 515 0.77
1.2 * Go #4 0.82 6,402 689 0.83
1.2 * F# #6 0.84 40,571 917 0.83
1.4 PHP #5 1.01 17,302 405 0.98
1.4 PHP #4 1.02 17,355 396 0.99
1.4 PHP #3 1.03 17,367 510 1.00
1.6 * Julia #3 1.14 307,749 512 1.23
1.6 Node.js #4 1.15 71,688 487 1.16
1.6 Go 1.15 7,533 715 1.17
1.6 * Go #3 1.17 6,885 610 1.19
1.7 * Julia #2 1.25 315,859 686 1.30
1.8 * Racket #2 1.26 131,547 1142 1.20
1.8 * F# #4 1.32 41,902 887 1.33
1.9 * Python 3 #3 1.35 20,009 573 1.28
2.1 Haskell GHC #6 1.49 22,946 368 1.57
2.1 PHP #2 1.51 17,756 552 1.48
2.4 Haskell GHC #4 1.70 22,778 355 1.78
2.5 Go #2 1.76 7,823 740 1.80
2.9 Haskell GHC #3 2.07 22,929 387 2.16
2.9 Haskell GHC 2.08 22,962 466 2.18
2.9 Haskell GHC #2 2.09 22,790 592 2.17
3.5 Go #6 2.47 10,703 727 2.48
3.9 OCaml #5 2.77 9,834 465 2.76
4.0 Dart aot #2 2.86 18,436 496 2.90
4.4 Erlang #3 3.16 78,606 568 4.15
4.5 Dart aot #3 3.23 18,416 495 3.27
4.7 Erlang #2 3.34 82,969 518 5.12
4.7 Lisp SBCL #4 3.37 817,934 495 3.35
4.7 Lisp SBCL #3 3.38 817,897 499 3.36
4.8 Erlang 3.39 98,537 565 4.10
5.3 Julia #4 3.80 414,781 531 3.87
6.3 * Free Pascal #2 4.49 3,437 834 4.48
6.3 * Ada 2012 GNAT 4.49 7,631 1163 4.49
6.4 * C# naot #4 4.54 8,053 1135 4.53
6.5 Python 3 #4 4.63 12,718 348 4.59
7.0 Go #7 5.00 10,527 702 5.62
8.4 Lisp SBCL #2 6.00 836,059 655 5.99
10 Pharo Smalltalk 7.31 160,817 706 7.32
11 Java naot #5 8.09 230,797 925 8.09
12 Java naot 8.86 304,071 807 8.89
15 Racket 10.49 129,741 459 10.44
16 C# naot #7 11.42 11,723 579 7.67
17 Node.js #2 12.17 102,679 405 12.18
17 Node.js #3 12.25 102,257 431 12.27
19 Perl 13.47 16,441 471 13.44
21 Free Pascal 14.70 1,303 3068 14.70
25 Ruby 17.94 53,740 524 17.90
139 * Haskell GHC #5 98.98 15,741 934 99.13
139 * C# naot #5 99.09 8,466 990 99.06
144 PHP 102.79 18,395 756 102.73
Java naot #2 Empty
Java naot #4 Empty
Java naot #3 Empty
Lua #7 Empty
Lua #5 Empty
Lua Empty
OCaml #7 Empty
Perl #2 Empty
Perl #4 Empty
Python 3 #5 Empty
Ruby #2 Empty
Ruby #5 Empty