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