The Computer Language
24.09 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 Chapel #2 0.76 19,436 423 0.76 98% 0% 2% 1%
1.0 Intel Fortran #4 0.88 19,648 987 0.88 100% 0% 0% 1%
1.0 OCaml #5 2.75 19,676 465 2.75 0% 0% 100% 0%
1.0 Perl 13.27 19,684 471 13.26 0% 100% 0% 0%
1.0 C gcc #2 0.82 19,704 422 0.82 100% 1% 1% 1%
1.0 C gcc 0.89 19,704 459 0.88 1% 100% 0% 1%
1.0 Free Pascal 14.68 19,720 3068 14.67 0% 0% 100% 0%
1.0 C++ g++ #4 0.89 19,736 521 0.88 1% 1% 1% 100%
1.0 Rust #4 0.71 19,804 804 0.71 100% 0% 1% 0%
1.0 PHP #4 0.98 19,804 396 0.98 0% 0% 1% 100%
1.0 PHP 5 min 19,804 756 5 min 0% 100% 0% 0%
1.0 PHP #3 0.98 19,804 510 0.98 0% 1% 100% 0%
1.0 Dart #2 2.86 19,808 496 2.90 0% 2% 99% 0%
1.0 Go #7 4.99 19,808 702 5.61 31% 29% 26% 28%
1.0 Go #8 2.46 19,808 727 2.47 0% 100% 0% 1%
1.0 Haskell GHC #6 1.44 19,808 368 1.52 2% 30% 40% 31%
1.0 Haskell GHC 2.07 19,808 466 2.14 3% 3% 72% 26%
1.0 Go 1.18 19,808 715 1.20 1% 0% 72% 28%
1.0 Haskell GHC #3 2.05 19,808 387 2.12 21% 49% 14% 19%
1.0 Dart #3 3.22 19,808 495 3.27 0% 99% 0% 0%
1.0 Haskell GHC #4 1.66 19,808 355 1.74 51% 3% 1% 48%
1.0 Go #2 1.84 19,808 740 1.89 38% 1% 29% 34%
1.0 Haskell GHC #2 2.08 19,808 592 2.14 30% 40% 3% 30%
1.0 PHP #2 1.47 19,932 552 1.47 0% 100% 0% 2%
1.0 PHP #5 0.96 19,932 405 0.96 100% 1% 1% 0%
2.8 C# .NET #7 6.59 53,412 579 7.20 4% 37% 45% 23%
2.9 VW Smalltalk #4 8.42 55,680 757 8.42 0% 99% 0% 0%
3.0 Node.js #4 1.08 57,404 487 1.11 1% 100% 2% 1%
3.6 Erlang #3 3.15 68,836 568 4.20 30% 69% 5% 29%
3.9 Erlang #2 3.26 75,544 518 5.16 27% 52% 26% 55%
4.0 Racket 10.41 77,992 459 10.41 0% 100% 0% 0%
4.4 Node.js #3 12.48 85,704 431 12.51 0% 99% 0% 0%
4.4 Node.js #2 12.35 85,896 405 12.38 0% 100% 1% 0%
4.9 Erlang 3.36 94,388 565 4.11 10% 23% 7% 81%
5.4 Ruby yjit 17.73 104,576 524 17.72 0% 100% 0% 0%
15 Matz's Ruby #5 1.52 285,696 488 1.52 88% 2% 0% 12%
25 Java  7.68 482,056 807 8.75 42% 19% 30% 23%
41 Lisp SBCL #3 3.32 785,792 499 3.32 0% 0% 0% 99%
41 Lisp SBCL #4 3.33 793,088 495 3.33 100% 0% 0% 0%
42 Lisp SBCL #2 5.95 811,008 655 5.95 0% 0% 100% 0%
52 Ruby yjit #5 1.50 1,011,072 494 1.50 100% 0% 2% 0%
126 Ruby yjit #2 3.10 2,431,144 666 3.09 100% 0% 1% 0%
Lua #7 Failed
Lua #5 Failed
Lua Failed
OCaml #7 Make Error
Perl #2 Failed
Perl #4 Failed
Python 3 #5 Failed
Matz's Ruby #2 Failed
Matz's Ruby Bad Output
 
 
  hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs cpu load
1.0 Python 3 #3 1.26 19,312 573 1.26 2% 100% 0% 0%
1.0 Chapel #4 0.75 19,436 515 0.76 98% 0% 0% 1%
1.0 Swift #2 0.75 19,440 606 0.75 0% 0% 0% 100%
1.0 Ada 2012 GNAT 4.49 19,568 1163 4.49 0% 0% 100% 0%
1.0 Ada 2012 GNAT #2 0.74 19,568 1137 0.74 0% 0% 100% 1%
1.0 Free Pascal #2 5.37 19,672 834 5.37 0% 0% 100% 0%
1.0 C++ g++ #5 0.87 19,736 804 0.87 2% 0% 0% 100%
1.0 Rust 0.74 19,804 1426 0.74 0% 100% 0% 0%
1.0 Rust #3 0.74 19,804 1373 0.74 0% 1% 100% 1%
1.0 Rust #2 0.74 19,804 1312 0.74 1% 100% 2% 0%
1.0 Haskell GHC #5 98.91 19,808 934 99.06 91% 8% 0% 0%
1.0 Go #4 0.82 19,808 689 0.83 100% 0% 0% 1%
1.0 Go #3 1.40 19,808 610 1.44 41% 39% 16% 7%
1.0 Free Pascal #3 0.87 20,008 536 0.87 0% 1% 0% 100%
1.6 F# .NET #6 0.96 31,680 917 0.95 97% 1% 0% 2%
1.7 C# .NET #6 0.96 33,240 1182 0.95 0% 0% 3% 99%
1.7 F# .NET #4 1.34 33,524 887 1.37 98% 0% 2% 3%
1.8 C# .NET #4 1.36 33,952 1135 1.35 2% 99% 0% 1%
1.8 C# .NET #5 0.93 35,096 990 0.96 4% 1% 1% 97%
2.2 Java #3 0.80 41,900 770 0.83 2% 98% 0% 2%
2.4 Java #2 1.29 45,768 944 1.37 3% 5% 99% 0%
4.1 Racket #2 1.18 79,120 1142 1.18 0% 0% 100% 0%
13 Julia #3 1.30 241,520 512 1.71 5% 98% 0% 27%
13 Julia #2 1.40 253,056 686 1.78 8% 98% 2% 20%