/mobile Handheld Friendly website

 pidigits benchmark N=10,000

Each chart bar shows how many times more Memory, one ↓ pidigits program used, compared to the program that used least Memory.

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.

Column × shows how many times more each program used compared to the benchmark program that used least.

    sortsort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0Pascal Free Pascal 41.3441.356523042  100% 0% 0% 0%
1.3Pascal Free Pascal #2 3.763.76856785  0% 100% 1% 1%
1.3C gcc 2.502.50868448  0% 4% 100% 0%
1.7C gcc #4 2.682.681,132541  1% 1% 0% 100%
2.2C++ g++ #3 2.682.681,464682  1% 0% 2% 100%
2.3Fortran Intel #3 2.862.861,476975  1% 0% 0% 100%
2.3Fortran Intel #2 2.742.741,476934  0% 0% 100% 1%
2.6Rust 63.7563.781,676677  0% 1% 1% 100%
2.8Ada 2005 GNAT 3.763.771,8081143  1% 1% 100% 1%
2.9OCaml #4 11.5511.561,9121481  1% 0% 0% 100%
3.2Ada 2005 GNAT #2 2.682.682,0721254  0% 1% 100% 1%
4.9Go #4 7.356.903,216607  1% 2% 3% 100%
5.2PHP #5 2.782.793,412394  0% 0% 1% 100%
5.5PHP #4 2.802.803,576384  0% 0% 1% 100%
5.5Perl #4 5.465.473,600261  0% 1% 100% 0%
5.6PHP #3 2.882.893,644500  0% 0% 1% 100%
5.6Perl #2 6.206.213,660385  0% 1% 0% 100%
6.0PHP #2 4.554.563,912537  0% 1% 1% 100%
7.0OCaml #3 13.5113.524,548869  1% 0% 0% 100%
7.0OCaml #2 16.6016.624,572510  1% 74% 26% 0%
7.1Lisp SBCL 2.772.774,6441073  0% 0% 1% 100%
7.5Perl 17.1617.184,920452  0% 0% 2% 100%
7.6Python 3 13.4513.454,928242  2% 3% 1% 100%
8.2Python 3 #2 3.053.065,332256  1% 1% 0% 100%
8.2PHP 9 min9 min5,364736  88% 0% 0% 12%
8.4Python 3 #3 6.156.165,480521  0% 100% 1% 0%
8.7OCaml 3.803.815,700560  0% 0% 1% 100%
9.4Haskell GHC #4 4.953.496,152341  14% 15% 100% 13%
24C# Mono #3 3.943.9515,3601026  99% 1% 2% 1%
25F# Mono #3 3.953.9516,128903  0% 1% 100% 2%
28Java  #2 4.154.0418,352938  16% 84% 1% 1%
28Racket #2 3.083.0918,4721122  0% 1% 100% 1%
29Erlang HiPE 24.6924.7018,836559  1% 69% 31% 0%
33Erlang HiPE #2 24.1923.2021,200512  78% 0% 5% 22%
65Java  #4 13.144.7942,2121808  69% 65% 69% 74%
65Scala #4 4.593.9142,3641125  65% 6% 39% 9%
65Java  #3 12.884.7942,4361826  71% 66% 66% 69%
68C# Mono #2 58.4358.4944,088856  1% 17% 83% 1%
74F# Mono 79.8179.8948,372513  97% 1% 2% 2%
77Lisp SBCL #2 32.5532.6150,292645  1% 0% 100% 0%
101Clojure #5 6.565.2365,6041944  13% 92% 7% 16%
110Ruby #3 11.0711.0972,012242  1% 0% 1% 100%
111Ruby #4 11.0611.0872,388240  1% 1% 0% 100%
123Dart 43.0042.7280,340321  1% 0% 100% 1%
172Racket 28.2828.31112,068453  0% 0% 0% 100%
365Ruby 21.6221.66238,196518  1% 0% 100% 1%
567Java  27.0726.11369,760800  20% 32% 29% 25%
587Clojure #2 31.2127.52383,048571  27% 37% 25% 25%
593Clojure #3 34.2628.68386,548482  30% 28% 36% 27%
594Clojure #4 9.946.81387,2961794  21% 74% 10% 43%
933Ruby JRuby #4 21.0216.50608,068240  77% 13% 21% 18%
945Ruby JRuby #3 21.3916.50615,840242  17% 13% 70% 31%
992Ruby JRuby 36.2627.46646,964518  30% 31% 18% 56%
1,689Scala #3 28.3022.271,101,536479  50% 12% 12% 53%
Fortran Intel Bad Output1768
Perl #3 Bad Output301
Ruby #2 Failed653
Scala Failed355
"wrong" (different) algorithm / less comparable programs
 Python 3 #4 Failed  248
568Scala #2 11.509.59370,132632

 pidigits benchmark : Streaming arbitrary-precision arithmetic

diff program output N = 27 with this output file to check your program is correct before contributing.

We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.

Each program should use the same step-by-step spigot algorithm to calculate digits of Pi.

Each program should

Programs should adapt the step-by-step algorithm given on pages 4,6 & 7 of Unbounded Spigot Algorithms for the Digits of Pi (156KB pdf). (Not the deliberately obscure version given on page 2.)(Not the Rabinowitz-Wagon algorithm.)

In addition to language specific multiprecision arithmetic, we will accept programs that use GMP.

For more information see Eric W. Weisstein, "Pi Digits." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/PiDigits.html

Revised BSD license

  Home   Conclusions   License   Play