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.010.01?380  0% 0% 0% 100%
1.0Python 2 #4 0.010.01?380  0% 0% 100% 0%
1.3Python 2 #4 0.010.02?380  0% 0% 0% 50%
1.6Python development version #4 0.020.02?379  0% 0% 100% 0%
1.6Python development version #4 0.020.02?379  100% 0% 0% 0%
1.7Python development version #4 0.020.02?379  33% 0% 100% 0%
2.5Python 3 #4 0.030.03?379  100% 0% 0% 0%
2.5Cython #4 0.030.03?349  25% 100% 0% 0%
2.5Cython #4 0.030.03?349  0% 0% 0% 100%
2.5Cython #4 0.030.03?349  0% 100% 0% 0%
2.5Python 3 #4 0.030.03?379  25% 0% 0% 100%
2.6Python 3 #4 0.030.03?379  100% 0% 0% 0%
3.6Nuitka #4 0.040.04?379  0% 0% 0% 100%
3.6Nuitka #4 0.040.04?379  0% 0% 0% 100%
3.9Nuitka #4 0.040.05?379  33% 83% 0% 0%
55PyPy 2 #4 0.660.6686,508380  0% 100% 2% 0%
55PyPy 2 #4 0.660.6686,928380  3% 3% 100% 0%
55PyPy 2 #4 0.660.6686,656380  3% 100% 5% 3%
71Python development version #5 0.850.8510,132710  0% 100% 0% 0%
71Python development version #5 0.850.8510,048710  0% 100% 0% 0%
71Python development version #5 0.850.8510,016710  100% 0% 1% 0%
75Pyston 0.900.9026,528322  1% 100% 0% 0%
76Pyston 0.910.9126,560322  0% 4% 95% 0%
76Pyston 0.910.9126,480322  100% 0% 0% 1%
78Nuitka #2 0.930.9412,500389  1% 0% 3% 100%
79Nuitka #2 0.940.9512,504389  2% 4% 1% 100%
80Nuitka #2 0.950.9612,728389  100% 7% 4% 4%
80Nuitka #5 0.960.9612,676710  100% 5% 1% 2%
80Nuitka #5 0.960.9612,724710  2% 1% 2% 100%
80Nuitka #5 0.960.9712,544710  77% 26% 1% 3%
81Python 2 #2 0.970.978,636389  100% 0% 1% 1%
81Python 2 #2 0.970.978,672389  0% 100% 0% 0%
81Python 2 #2 0.970.978,772389  0% 100% 0% 1%
82Python development version #2 0.990.999,892389  0% 0% 0% 100%
83Python development version #2 0.990.999,592389  0% 99% 0% 0%
83Python development version #2 0.990.999,880389  99% 0% 2% 1%
85Cython #2 1.021.0211,420364  1% 3% 1% 99%
85Cython #2 1.021.0211,372364  1% 1% 1% 100%
86Cython #2 1.021.0311,412364  4% 2% 100% 0%
86Python 3 #5 1.031.0411,724710  100% 1% 1% 1%
86Python 3 #5 1.031.0411,512710  0% 1% 1% 100%
87Python 3 #5 1.031.0411,708710  3% 1% 0% 100%
87Python 3 #2 1.041.0411,436389  100% 1% 1% 0%
87Python 3 #2 1.041.0411,052389  1% 100% 1% 1%
87Python 3 #2 1.041.0411,316389  1% 0% 100% 2%
157Nuitka #3 1.881.8812,956664  4% 4% 100% 11%
158Nuitka #3 1.891.9012,784664  2% 9% 1% 99%
158Python development version #3 1.901.909,648664  1% 0% 100% 0%
158Python 2 #3 1.901.909,024664  0% 0% 1% 100%
158Nuitka #3 1.901.9012,964664  3% 6% 3% 100%
159Python 2 #3 1.901.909,012664  1% 1% 100% 0%
159Python development version #3 1.901.909,712664  0% 0% 100% 1%
159Python development version #3 1.901.919,720664  0% 46% 1% 54%
159Python 2 #3 1.911.919,112664  0% 79% 0% 22%
160Cython #3 1.911.9211,292639  1% 31% 1% 69%
160Cython #3 1.911.9211,284639  4% 1% 2% 100%
160Cython #3 1.921.9211,616639  2% 100% 2% 1%
163Python 3 #3 1.951.9511,164664  2% 1% 100% 2%
163Python 3 #3 1.951.9511,572664  100% 2% 2% 2%
163Python 3 #3 1.951.9611,332664  2% 15% 1% 85%
230PyPy 2 #2 2.742.761,952,424389  5% 15% 79% 2%
234Nuitka 2.792.8011,512322  100% 2% 2% 1%
234Nuitka 2.792.8011,308322  1% 2% 5% 100%
234Nuitka 2.802.8111,004322  62% 2% 41% 3%
238Cython 2.852.8610,008322  1% 1% 100% 1%
239Cython 2.862.879,712322  1% 3% 100% 2%
239Cython 2.862.879,976322  100% 1% 1% 0%
239Python 3 2.872.879,872322  1% 100% 1% 0%
240Python 3 2.872.889,768322  1% 1% 100% 1%
240Python 3 2.872.889,868322  1% 0% 1% 100%
241PyPy 2 #2 2.892.892,039,760389  100% 0% 0% 0%
251PyPy 2 #2 3.013.012,058,188389  14% 2% 87% 1%
252PyPy 2 3.023.0284,536322  0% 0% 100% 0%
253PyPy 2 3.033.0385,140322  100% 1% 0% 0%
253PyPy 2 3.033.0384,836322  100% 1% 0% 0%
256Python development version 3.073.078,668322  0% 0% 100% 0%
257Python development version 3.083.088,488322  0% 100% 0% 1%
257Python development version 3.083.088,384322  1% 0% 100% 0%
257Python 2 3.083.087,408322  100% 0% 0% 0%
257Python 2 3.093.097,368322  100% 0% 0% 0%
257Python 2 3.093.097,400322  0% 100% 1% 0%
267PyPy 3 3.163.2075,260322  8% 92% 10% 13%
296PyPy 3 3.503.5575,484322  31% 94% 27% 27%
297PyPy 3 3.513.5675,204322  25% 37% 86% 31%
372PyPy 2 #3 4.464.461,476,100664  100% 3% 1% 0%
374PyPy 2 #3 4.484.481,444,928664  1% 100% 0% 1%
375PyPy 2 #3 4.504.501,442,300664  0% 1% 0% 100%
450Jython 8.845.40290,952322  34% 45% 51% 35%
453Jython 8.865.44294,580322  29% 51% 30% 54%
469Jython 9.425.63324,056322  47% 39% 41% 40%
1,057IronPython 13.1212.6877,680322  58% 2% 41% 2%
1,057IronPython 13.1512.6979,276322  1% 29% 5% 68%
1,057IronPython 13.1412.6978,604322  0% 57% 3% 42%
1,136MicroPython 13.3113.644,304322  30% 29% 52% 77%
1,152MicroPython 13.6713.824,180322  55% 45% 72% 36%
1,229MicroPython 14.1214.754,320322  56% 57% 76% 59%
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