The Computer Language
25.01 Benchmarks Game

pidigits

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.

 

Arbitrary precision arithmetic might be provided by wrapping a third-party library written in some-other programming language. How would you know?

Always look at the source code.

× source secs mem gz cpu secs
1.0 Rust #4 0.72 3,994 804 0.71
1.0 C++ g++ #4 0.72 6,496 521 0.71
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 C gcc 0.75 3,727 459 0.74
1.1 Chapel #2 0.80 11,543 423 0.77
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 Node.js #4 1.15 71,004 487 1.16
1.6 Go 1.15 7,533 715 1.17
2.0 Haskell GHC #6 1.44 22,929 368 1.54
2.1 PHP #2 1.51 17,756 552 1.48
2.3 Haskell GHC #4 1.67 22,684 355 1.77
2.5 Go #2 1.76 7,823 740 1.80
2.9 Haskell GHC #3 2.07 22,970 387 2.16
2.9 Haskell GHC #2 2.09 22,884 592 2.18
2.9 Haskell GHC 2.10 23,073 466 2.19
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 #2 2.85 18,768 496 2.90
4.4 Erlang #3 3.16 78,606 568 4.15
4.5 Dart #3 3.23 18,485 495 3.28
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.7 Erlang 3.39 98,537 565 4.10
5.3 Julia #4 3.76 414,806 531 3.82
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  7.72 423,014 807 8.76
15 Racket 10.49 129,683 459 10.44
16 C# .NET #7 11.24 44,225 579 8.14
17 Node.js #2 12.19 101,380 405 12.20
17 Node.js #3 12.28 101,482 431 12.29
19 Perl 13.47 16,441 471 13.44
21 Free Pascal 14.70 1,303 3068 14.70
25 Ruby yjit 17.94 53,740 524 17.90
144 PHP 102.79 18,395 756 102.73
Lua #7 Empty
Lua #5 Empty
Lua Empty
OCaml #7 Empty
Perl #2 Empty
Perl #4 Empty
Python 3 #5 Empty
Ruby yjit #2 Empty
Ruby yjit #5 Empty
 
 
  * possible hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs
1.0 * C++ g++ #5 0.73 6,300 804 0.73
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 0.75 4,239 1426 0.75
1.0 * Rust #2 0.75 4,243 1312 0.75
1.0 * Rust #3 0.75 4,481 1373 0.75
1.1 * Swift #2 0.76 14,238 606 0.75
1.1 * Chapel #4 0.80 11,416 515 0.77
1.2 * Go #4 0.82 6,402 689 0.83
1.2 * C# .NET #6 0.84 35,021 1182 0.82
1.2 * Java #3 0.84 60,449 770 0.84
1.2 * F# .NET #6 0.85 40,714 917 0.83
1.2 * C# .NET #5 0.87 37,380 990 0.89
1.6 * Julia #3 1.13 307,601 512 1.23
1.6 * Go #3 1.17 6,885 610 1.19
1.7 * Julia #2 1.24 315,621 686 1.31
1.8 * Racket #2 1.27 131,396 1142 1.21
1.8 * C# .NET #4 1.32 35,627 1135 1.30
1.8 * F# .NET #4 1.32 42,037 887 1.33
1.9 * Java #2 1.33 64,856 944 1.39
1.9 * Python 3 #3 1.35 20,009 573 1.28
6.3 * Free Pascal #2 4.49 3,437 834 4.48
6.3 * Ada 2012 GNAT 4.49 7,631 1163 4.49
138 * Haskell GHC #5 98.97 15,725 934 99.12