The Computer Language
24.12 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 and cpu load). 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 cpu load
1.0 Python 3 #4 4.54 19,312 348 4.54 0% 0% 100% 0%
1.0 Haskell GHC #4 1.66 19,808 355 1.74 51% 3% 1% 48%
1.1 Haskell GHC #6 1.44 19,808 368 1.52 2% 30% 40% 31%
1.1 Haskell GHC #3 2.05 19,808 387 2.12 21% 49% 14% 19%
1.1 PHP #4 0.99 19,768 396 0.99 3% 0% 100% 0%
1.2 Node.js #2 12.16 87,228 405 12.19 10% 89% 0% 0%
1.2 PHP #5 0.97 19,768 405 0.97 0% 1% 100% 1%
1.2 C gcc #2 0.74 19,772 422 0.74 2% 100% 2% 0%
1.2 Chapel #2 0.75 19,620 423 0.76 100% 1% 1% 1%
1.2 Node.js #3 12.25 87,708 431 12.28 11% 88% 0% 0%
1.3 C gcc 0.74 19,772 459 0.74 0% 100% 2% 1%
1.3 Racket 10.41 77,992 459 10.41 0% 100% 0% 0%
1.3 OCaml #5 2.75 19,676 465 2.75 0% 0% 100% 0%
1.3 Haskell GHC 2.07 19,808 466 2.14 3% 3% 72% 26%
1.4 Perl 13.27 19,684 471 13.26 0% 100% 0% 0%
1.4 Node.js #4 1.11 59,620 487 1.14 1% 99% 1% 2%
1.4 Matz's Ruby #5 1.52 285,696 488 1.52 88% 2% 0% 12%
1.4 Lisp SBCL #4 3.33 793,088 495 3.33 100% 0% 0% 0%
1.4 Dart #3 3.23 19,780 495 3.27 0% 9% 0% 91%
1.4 Dart #2 2.85 19,780 496 2.89 1% 99% 1% 1%
1.4 Lisp SBCL #3 3.32 785,792 499 3.32 0% 0% 0% 99%
1.5 PHP #3 0.99 19,768 510 0.99 1% 100% 1% 0%
1.5 Erlang #2 3.26 75,544 518 5.16 27% 52% 26% 55%
1.5 C++ g++ #4 0.71 19,760 521 0.71 0% 100% 0% 1%
1.5 Ruby yjit 18.03 49,168 524 18.03 91% 8% 0% 0%
1.5 Julia #4 2.70 290,468 531 2.83 4% 1% 100% 0%
1.6 PHP #2 1.49 19,768 552 1.49 100% 0% 1% 0%
1.6 Erlang 3.36 94,388 565 4.11 10% 23% 7% 81%
1.6 Erlang #3 3.15 68,836 568 4.20 30% 69% 5% 29%
1.7 C# .NET #7 7.15 38,160 579 7.25 8% 3% 91% 0%
1.7 Haskell GHC #2 2.08 19,808 592 2.14 30% 40% 3% 30%
1.9 Lisp SBCL #2 5.95 811,008 655 5.95 0% 0% 100% 0%
2.0 Go #7 4.99 19,808 702 5.61 31% 29% 26% 28%
2.1 Go 1.18 19,808 715 1.20 1% 0% 72% 28%
2.1 Go #6 2.46 19,512 727 2.46 0% 0% 100% 1%
2.1 Go #2 1.84 19,808 740 1.89 38% 1% 29% 34%
2.2 PHP 102.67 19,768 756 102.65 41% 58% 0% 0%
2.2 VW Smalltalk #4 8.42 55,680 757 8.42 0% 99% 0% 0%
2.3 Rust #4 0.71 19,624 804 0.71 0% 1% 1% 100%
2.3 Java  7.68 482,056 807 8.75 42% 19% 30% 23%
2.8 Intel Fortran #4 0.88 19,648 987 0.88 100% 0% 0% 1%
8.8 Free Pascal 14.68 19,720 3068 14.67 0% 0% 100% 0%
Lua #7 Failed
Lua #5 Failed
Lua Failed
OCaml #7 Make Error
Perl #2 Failed
Perl #4 Failed
Python 3 #5 Failed
Ruby yjit #2 Failed
Ruby yjit #5 Failed
Matz's Ruby #2 Failed
Matz's Ruby Bad Output
 
 
  * possible hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs cpu load
1.5 * Julia #3 1.04 223,936 512 1.18 2% 7% 98% 11%
1.5 * Chapel #4 0.76 19,620 515 0.76 98% 2% 1% 2%
1.5 * Free Pascal #3 0.87 20,008 536 0.87 0% 1% 0% 100%
1.6 * Python 3 #3 1.26 19,312 573 1.26 2% 100% 0% 0%
1.7 * Swift #2 0.75 19,440 606 0.75 0% 0% 0% 100%
1.8 * Go #3 1.40 19,808 610 1.44 41% 39% 16% 7%
2.0 * Julia #2 1.14 232,460 686 1.26 98% 4% 0% 9%
2.0 * Go #4 0.82 19,808 689 0.83 100% 0% 0% 1%
2.2 * Java #3 0.80 41,900 770 0.83 2% 98% 0% 2%
2.3 * C++ g++ #5 0.73 19,760 804 0.73 1% 0% 100% 1%
2.4 * Free Pascal #2 5.37 19,672 834 5.37 0% 0% 100% 0%
2.5 * F# .NET #4 1.29 35,924 887 1.32 0% 99% 3% 1%
2.6 * F# .NET #6 0.82 34,472 917 0.82 3% 0% 98% 0%
2.7 * Haskell GHC #5 98.91 19,808 934 99.06 91% 8% 0% 0%
2.7 * Java #2 1.29 45,768 944 1.37 3% 5% 99% 0%
2.8 * C# .NET #5 0.84 33,264 990 0.88 42% 57% 6% 1%
3.3 * C# .NET #4 1.29 31,392 1135 1.29 100% 1% 2% 1%
3.3 * Ada 2012 GNAT #2 0.74 19,772 1137 0.74 100% 0% 0% 0%
3.3 * Racket #2 1.18 79,120 1142 1.18 0% 0% 100% 0%
3.3 * Ada 2012 GNAT 4.49 19,772 1163 4.48 100% 0% 0% 0%
3.4 * C# .NET #6 0.82 30,744 1182 0.82 0% 98% 2% 1%
3.8 * Rust #2 0.74 19,624 1312 0.74 1% 0% 100% 1%
3.9 * Rust #3 0.74 19,624 1373 0.74 0% 100% 0% 1%
4.1 * Rust 0.74 19,624 1426 0.74 100% 0% 0% 4%