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% 100% 0%
1.0Python 2 #4 0.010.01?380  0% 0% 0% 100%
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.3Cython #4 0.030.03?349  67% 0% 0% 0%
2.3Cython #4 0.030.03?349  0% 0% 100% 0%
2.3Python 3 #4 0.030.03?379  0% 0% 0% 100%
2.3Cython #4 0.030.03?349  0% 0% 100% 0%
2.3Python 3 #4 0.030.03?379  0% 0% 0% 75%
2.8Python 3 #4 0.030.03?379  0% 67% 33% 0%
3.3Nuitka #4 0.040.04?379  0% 0% 0% 100%
3.3Nuitka #4 0.040.04?379  0% 0% 0% 100%
3.6Nuitka #4 0.040.04?379  0% 75% 0% 20%
33PyPy 2 #4 0.390.391,480380  98% 0% 3% 0%
33PyPy 2 #4 0.390.391,440380  5% 95% 0% 0%
33PyPy 2 #4 0.390.401,484380  100% 0% 3% 0%
42PyPy 3 #4 0.500.5173,560379  96% 2% 0% 8%
42PyPy 3 #4 0.500.5173,792379  100% 2% 0% 0%
42PyPy 3 #4 0.510.5173,760379  0% 0% 2% 98%
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%
71Python 3 #5 0.850.8611,068710  98% 0% 0% 2%
71Nuitka #5 0.860.8612,708710  100% 0% 0% 0%
71Nuitka #5 0.860.8612,320710  100% 0% 1% 0%
71Nuitka #5 0.860.8612,656710  0% 0% 100% 0%
71Python 3 #5 0.860.8611,284710  0% 0% 0% 99%
72Python 3 #5 0.860.8611,420710  0% 0% 1% 100%
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%
77Nuitka #2 0.920.9212,500389  96% 0% 0% 3%
77Nuitka #2 0.920.9212,324389  1% 100% 0% 1%
77Nuitka #2 0.930.9312,360389  1% 0% 99% 0%
81Python 2 #2 0.970.978,636389  100% 0% 1% 1%
81Python 2 #2 0.970.978,672389  0% 100% 0% 0%
81Cython #2 0.970.9711,068364  0% 0% 100% 0%
81Cython #2 0.970.9711,104364  0% 100% 0% 2%
81Cython #2 0.970.9711,260364  0% 0% 0% 100%
81Python 2 #2 0.970.978,772389  0% 100% 0% 1%
82Python 3 #2 0.990.9911,212389  100% 1% 1% 0%
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%
83Python 3 #2 0.990.9911,152389  1% 0% 100% 0%
83Python 3 #2 0.991.0011,200389  0% 2% 98% 1%
153Nuitka #3 1.831.8312,736664  0% 1% 0% 100%
153Nuitka #3 1.831.8312,920664  0% 0% 100% 0%
153Nuitka #3 1.831.8412,876664  1% 0% 100% 0%
156Cython #3 1.871.8711,224639  0% 0% 100% 1%
156Cython #3 1.871.8711,140639  1% 0% 100% 1%
156Cython #3 1.871.8711,504639  0% 100% 1% 1%
158Python 3 #3 1.901.9011,152664  0% 0% 0% 100%
158Python 2 #3 1.901.909,024664  0% 0% 1% 100%
158Python development version #3 1.901.909,648664  1% 0% 100% 0%
159Python 2 #3 1.901.909,012664  1% 1% 100% 0%
159Python development version #3 1.901.909,712664  0% 0% 100% 1%
159Python 3 #3 1.901.9011,108664  0% 1% 0% 100%
159Python development version #3 1.901.919,720664  0% 46% 1% 54%
159Python 2 #3 1.911.919,112664  0% 79% 0% 22%
159Python 3 #3 1.911.9111,308664  0% 0% 1% 99%
198PyPy 2 #2 2.382.381,629,952389  0% 100% 0% 0%
216PyPy 2 #2 2.592.591,787,532389  100% 0% 0% 0%
216PyPy 2 #2 2.592.592,050,892389  1% 0% 1% 99%
220PyPy 3 #2 2.642.642,624,504389  99% 0% 0% 1%
229Nuitka 2.742.7411,292322  0% 0% 0% 100%
229Nuitka 2.742.7411,452322  0% 100% 0% 0%
229PyPy 3 #2 2.742.742,742,916389  0% 0% 0% 100%
229Nuitka 2.752.7511,084322  0% 0% 0% 100%
230PyPy 3 #2 2.762.772,831,992389  0% 100% 0% 0%
233Cython 2.802.809,788322  100% 0% 0% 0%
233Cython 2.802.809,808322  100% 0% 0% 0%
233Cython 2.802.809,876322  100% 0% 0% 0%
234Python 3 2.812.819,788322  100% 0% 0% 0%
234Python 3 2.812.819,720322  0% 100% 0% 0%
234PyPy 2 2.812.8174,040322  100% 0% 0% 0%
235Python 3 2.812.829,880322  100% 0% 0% 0%
235PyPy 2 2.822.8273,880322  0% 0% 1% 99%
236PyPy 2 2.832.8374,016322  0% 65% 0% 36%
246PyPy 3 2.952.9567,488322  0% 0% 0% 100%
246PyPy 3 2.952.9567,344322  0% 0% 0% 100%
247PyPy 3 2.962.9667,308322  99% 0% 0% 1%
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%
359PyPy 3 #3 4.314.311,967,028664  0% 1% 99% 0%
361PyPy 2 #3 4.314.331,407,000664  99% 0% 0% 1%
367PyPy 2 #3 4.404.401,402,200664  0% 40% 0% 60%
367PyPy 2 #3 4.404.411,402,184664  0% 0% 0% 100%
396PyPy 3 #3 4.754.751,881,888664  0% 0% 0% 100%
399PyPy 3 #3 4.794.791,885,944664  0% 0% 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,029MicroPython 12.3512.354,244322  0% 0% 100% 0%
1,029MicroPython 12.3512.354,172322  100% 0% 0% 0%
1,030MicroPython 12.3512.364,216322  0% 0% 100% 0%
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%
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