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  0% 33% 100% 0%
1.0Python 2 #4 0.020.02?378  33% 0% 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.5Python 3 #4 0.030.04?379  0% 0% 0% 100%
1.6Cython #4 0.030.04?379  0% 0% 100% 0%
1.6Python 3 #4 0.030.04?379  25% 0% 20% 75%
1.7Cython #4 0.030.04?379  0% 0% 50% 100%
1.7Python 3 #4 0.040.04?379  0% 0% 0% 100%
2.2Nuitka #4 0.050.05?379  0% 0% 0% 100%
2.3Cython #4 0.030.05?379  0% 57% 50% 0%
2.3Nuitka #4 0.050.05?379  100% 17% 0% 0%
2.3Nuitka #4 0.050.05?379  0% 0% 0% 100%
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.920.9212,696672  1% 0% 100% 1%
40Python 3 #5 0.920.9211,164672  99% 2% 2% 1%
40Nuitka #5 0.930.9312,600672  2% 1% 99% 0%
41Python development version #5 0.940.949,880672  3% 100% 0% 11%
41Python 3 #5 0.950.9511,012672  7% 2% 99% 2%
42Nuitka #5 0.960.9612,484672  4% 100% 2% 5%
42Python 3 #5 0.950.9711,040672  6% 4% 4% 100%
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 1.001.0012,236364  100% 0% 1% 0%
44Nuitka #2 1.011.0212,480364  0% 100% 2% 3%
46Pyston 1.051.0636,552322  100% 1% 4% 4%
46Nuitka #2 1.031.0612,468364  1% 5% 0% 95%
47Cython #2 1.071.0710,396364  1% 100% 1% 1%
47Cython #2 1.071.0810,556364  3% 4% 0% 100%
47Cython #2 1.081.0910,408364  4% 0% 100% 2%
48Python development version #2 1.091.099,656364  0% 4% 1% 100%
48Python 3 #2 1.111.1110,932364  4% 99% 3% 1%
48Python development version #2 1.081.119,588364  96% 4% 2% 1%
48Python 2 #2 1.111.127,404363  97% 11% 6% 9%
49Python 3 #2 1.111.1210,796364  4% 1% 100% 2%
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.121.1211,068364  4% 4% 100% 2%
56Python 2 #2 1.281.297,248363  100% 25% 19% 27%
88Nuitka #3 2.012.0212,504639  0% 0% 0% 100%
88Nuitka #3 2.032.0312,600639  4% 100% 0% 0%
89Nuitka #3 2.052.0512,720639  0% 0% 100% 0%
89Cython #3 2.042.0510,640639  3% 4% 3% 100%
90Python 2 #3 2.072.077,560638  3% 2% 1% 100%
90Cython #3 2.072.0810,508639  3% 100% 25% 2%
91Python 3 #3 2.092.0911,060639  19% 2% 86% 1%
91Python 3 #3 2.092.1010,892639  4% 100% 3% 2%
91Cython #3 2.102.1010,600639  5% 5% 100% 5%
91Python 3 #3 2.102.1011,028639  5% 2% 3% 100%
92Python development version #3 2.112.119,940639  7% 100% 6% 1%
92Python 2 #3 2.112.127,580638  7% 100% 4% 5%
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%
145Nuitka 3.343.3411,072322  0% 1% 0% 100%
147Nuitka 3.383.3811,384322  0% 100% 3% 1%
148Nuitka 3.393.4011,068322  21% 0% 79% 0%
151Python 3 3.473.479,436322  100% 3% 4% 2%
153Python 3 3.513.519,580322  4% 5% 100% 4%
154Python 3 3.543.559,716322  5% 5% 100% 5%
161PyPy 3 3.703.7073,516322  0% 100% 0% 1%
162Python 2 3.723.736,784322  39% 3% 63% 2%
162PyPy 3 3.723.7373,248322  100% 2% 1% 1%
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%
170Cython 3.913.929,152322  41% 11% 59% 9%
171Cython 3.933.939,128322  7% 7% 5% 100%
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%
186Cython 4.264.288,924322  86% 44% 19% 23%
330Jython 12.727.59283,068322  57% 45% 40% 36%
335Jython 13.137.71291,372322  44% 42% 51% 43%
336Jython 13.077.73282,640322  44% 51% 45% 38%
411MicroPython 9.469.464,192322  1% 1% 1% 100%
412MicroPython 9.479.484,208322  2% 1% 0% 100%
413MicroPython 9.499.494,120322  2% 1% 100% 0%
804IronPython 18.8118.4899,512322  5% 2% 3% 99%
804IronPython 18.8918.49102,160322  2% 4% 100% 5%
838IronPython 19.1619.2796,556322  6% 96% 4% 5%
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