pidigits benchmark N=10,000

Each chart bar shows how many times slower, one ↓ pidigits program was, compared to the fastest program.

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.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0Python 2 #4 0.020.02?378  33% 0% 100% 0%
1.0Python 2 #4 0.020.02?378  0% 33% 100% 0%
1.1Python 2 #4 0.020.03?378  0% 0% 100% 0%
1.2Python development version #4 0.020.03?379  0% 67% 0% 0%
1.2Python development version #4 0.020.03?379  75% 0% 0% 0%
1.3Python development version #4 0.030.03?379  33% 67% 0% 25%
1.6Python 3 #4 0.040.04?379  0% 0% 0% 100%
1.7Python 3 #4 0.040.04?379  100% 0% 0% 0%
1.7Python 3 #4 0.040.04?379  0% 100% 0% 0%
1.7Cython #4 0.040.04?379  20% 25% 100% 0%
1.8Cython #4 0.040.04?379  0% 0% 100% 0%
2.2Nuitka #4 0.050.05?379  0% 83% 0% 0%
2.3Nuitka #4 0.050.05?379  0% 0% 100% 0%
2.3Nuitka #4 0.050.05?379  100% 17% 0% 0%
4.4Cython #4 0.040.10?379  0% 90% 0% 0%
36PyPy 2 #4 0.820.8388,676378  1% 100% 0% 2%
37PyPy 2 #4 0.860.8687,824378  9% 99% 0% 1%
39Python development version #5 0.900.909,856672  0% 1% 100% 1%
39PyPy 2 #4 0.850.9187,164378  1% 3% 26% 71%
40Nuitka #5 0.910.9212,544672  2% 1% 5% 100%
40Nuitka #5 0.930.9312,412672  100% 2% 1% 2%
41Python 3 #5 0.940.9410,984672  2% 97% 1% 0%
41Python 3 #5 0.940.9410,988672  1% 0% 100% 0%
41Python development version #5 0.940.949,880672  3% 100% 0% 11%
41Python 3 #5 0.940.9411,100672  3% 0% 100% 0%
42Pyston 0.970.9827,908322  2% 0% 100% 1%
43Python development version #5 0.980.989,784672  100% 16% 13% 9%
43Pyston 0.980.9828,828322  2% 100% 0% 4%
43Nuitka #2 0.980.9812,484364  2% 1% 1% 100%
44Nuitka #2 1.001.0112,388364  2% 1% 100% 1%
44Nuitka #2 1.021.0212,356364  100% 1% 4% 1%
44Nuitka #5 0.951.0212,420672  2% 1% 0% 95%
46Pyston 1.051.0636,552322  100% 1% 4% 4%
47Cython #2 1.071.0711,300364  100% 1% 1% 3%
47Cython #2 1.081.0811,160364  100% 0% 1% 1%
47Cython #2 1.081.0810,984364  2% 0% 100% 3%
48Python development version #2 1.091.099,656364  0% 4% 1% 100%
48Python development version #2 1.081.119,588364  96% 4% 2% 1%
48Python 3 #2 1.111.1110,784364  0% 100% 0% 1%
48Python 2 #2 1.111.127,404363  97% 11% 6% 9%
49Python development version #2 1.111.129,696364  100% 2% 2% 8%
49Python 2 #2 1.111.127,296363  2% 10% 100% 5%
49Python 3 #2 1.131.1310,876364  3% 0% 100% 1%
50Python 3 #2 1.121.1410,896364  1% 96% 1% 4%
56Python 2 #2 1.281.297,248363  100% 25% 19% 27%
86Cython #3 1.991.9911,180639  1% 2% 100% 1%
87Cython #3 2.002.0011,228639  100% 2% 1% 4%
87Cython #3 2.002.0010,916639  3% 1% 2% 99%
87Nuitka #3 2.002.0112,488639  2% 100% 1% 2%
87Nuitka #3 2.012.0112,580639  2% 1% 0% 100%
88Nuitka #3 2.032.0312,656639  100% 0% 0% 1%
90Python 2 #3 2.072.077,560638  3% 2% 1% 100%
91Python 3 #3 2.102.1010,948639  1% 0% 100% 0%
91Python 3 #3 2.102.1010,952639  1% 99% 0% 0%
92Python development version #3 2.112.119,940639  7% 100% 6% 1%
92Python 2 #3 2.112.127,580638  7% 100% 4% 5%
93Python 3 #3 2.132.1410,964639  0% 100% 0% 1%
93Python 2 #3 2.142.147,796638  100% 4% 8% 7%
95Python development version #3 2.182.199,900639  8% 8% 100% 7%
111Python development version #3 2.512.559,920639  55% 74% 40% 28%
147Cython 3.383.389,660322  86% 0% 14% 2%
147Nuitka 3.383.3811,016322  1% 2% 0% 100%
147Nuitka 3.393.3911,188322  1% 2% 0% 100%
147Cython 3.393.399,596322  0% 100% 1% 0%
148Cython 3.393.399,588322  100% 0% 1% 2%
149Nuitka 3.433.4311,216322  100% 1% 1% 1%
149Python 3 3.433.449,784322  0% 1% 0% 100%
151Python 3 3.483.489,536322  0% 1% 0% 100%
152Python 3 3.503.519,616322  100% 0% 1% 0%
161PyPy 3 3.703.7073,516322  0% 100% 0% 1%
162PyPy 3 3.723.7373,248322  100% 2% 1% 1%
162Python 2 3.723.736,784322  39% 3% 63% 2%
162PyPy 3 3.733.7373,676322  100% 1% 1% 0%
165PyPy 2 3.793.7983,908322  1% 2% 0% 100%
166PyPy 2 3.813.8184,656322  100% 0% 0% 1%
166Python 2 3.813.826,792322  8% 90% 14% 5%
166Python development version 3.823.838,352322  99% 5% 3% 4%
168PyPy 2 3.863.8685,424322  3% 2% 100% 0%
171Python development version 3.933.948,352322  21% 84% 6% 7%
171Python 2 3.943.946,784322  12% 8% 12% 100%
172Python development version 3.963.968,360322  6% 73% 7% 32%
375Jython 14.308.62280,268322  42% 49% 44% 45%
376Jython 14.528.64278,520322  45% 46% 50% 38%
376Jython 14.728.65281,748322  46% 50% 45% 42%
678MicroPython 15.5815.584,208322  100% 3% 1% 2%
680MicroPython 15.6415.644,144322  2% 84% 2% 17%
685MicroPython 15.7415.754,256322  52% 4% 50% 3%
710IronPython 16.9516.3380,368322  64% 1% 6% 33%
710IronPython 16.7316.3475,040322  55% 1% 40% 7%
711IronPython 16.8416.3582,164322  40% 61% 1% 1%
missing benchmark programs
Shedskin No program
Numba No program
Grumpy No program

 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