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.4Python development version #4 0.020.02?379  0% 0% 100% 0%
1.4Python development version #4 0.020.02?379  100% 0% 0% 0%
1.4Python 2 #4 0.020.02?380  50% 0% 100% 0%
1.4Python development version #4 0.020.02?379  33% 0% 100% 0%
2.1Python 3 #4 0.030.03?379  100% 0% 0% 0%
2.1Cython #4 0.030.03?349  100% 0% 0% 0%
2.1Cython #4 0.030.03?349  0% 0% 100% 0%
2.1Python 3 #4 0.030.03?379  25% 0% 0% 100%
2.1Cython #4 0.030.03?349  0% 0% 0% 100%
2.2Python 3 #4 0.030.03?379  100% 0% 0% 0%
3.1Nuitka #4 0.040.04?379  0% 0% 0% 80%
3.1Nuitka #4 0.040.04?379  20% 0% 0% 100%
3.1Nuitka #4 0.040.04?379  0% 80% 0% 0%
61Python development version #5 0.850.8510,132710  0% 100% 0% 0%
61Python development version #5 0.850.8510,016710  100% 0% 1% 0%
61Python development version #5 0.850.8510,048710  0% 100% 0% 0%
65Pyston 0.900.9026,528322  1% 100% 0% 0%
65Pyston 0.910.9126,560322  0% 4% 95% 0%
65Pyston 0.910.9126,480322  100% 0% 0% 1%
67Nuitka #2 0.930.9412,696389  100% 1% 2% 3%
67Nuitka #2 0.940.9412,592389  100% 0% 2% 2%
68Nuitka #2 0.950.9512,700389  1% 100% 2% 3%
68Nuitka #5 0.950.9512,580710  1% 2% 100% 1%
68Nuitka #5 0.950.9612,684710  100% 2% 3% 1%
68Nuitka #5 0.960.9612,592710  2% 3% 1% 100%
71Python development version #2 0.990.999,892389  0% 0% 0% 100%
71Python development version #2 0.990.999,592389  0% 99% 0% 0%
71Python development version #2 0.990.999,880389  99% 0% 2% 1%
73Python 2 #2 1.021.038,884389  100% 1% 2% 1%
74Python 3 #5 1.031.0411,724710  100% 1% 1% 1%
74Python 3 #5 1.031.0411,512710  0% 1% 1% 100%
74Python 3 #5 1.031.0411,708710  3% 1% 0% 100%
74Python 2 #2 1.041.048,820389  2% 3% 100% 3%
74Python 3 #2 1.041.0411,436389  100% 1% 1% 0%
74Cython #2 1.041.0411,136364  100% 3% 3% 8%
74Python 3 #2 1.041.0411,052389  1% 100% 1% 1%
74Cython #2 1.041.0410,996364  2% 3% 1% 99%
74Cython #2 1.041.0410,996364  4% 3% 100% 4%
75Python 3 #2 1.041.0411,316389  1% 0% 100% 2%
77Python 2 #2 1.071.088,972389  7% 99% 8% 9%
132Nuitka #3 1.851.8512,724664  1% 100% 1% 1%
133Nuitka #3 1.861.8612,764664  1% 100% 3% 2%
136Python development version #3 1.901.909,648664  1% 0% 100% 0%
136Python development version #3 1.901.909,712664  0% 0% 100% 1%
136Python development version #3 1.901.919,720664  0% 46% 1% 54%
137Nuitka #3 1.911.9212,968664  8% 98% 6% 6%
138Cython #3 1.921.9311,124639  0% 100% 1% 3%
138Cython #3 1.931.9311,284639  100% 2% 3% 2%
139Python 2 #3 1.941.949,020664  100% 2% 1% 2%
139Python 2 #3 1.941.948,972664  100% 3% 1% 1%
139Python 2 #3 1.941.959,268664  1% 99% 2% 2%
139Cython #3 1.951.9511,332639  6% 6% 100% 5%
139Python 3 #3 1.951.9511,164664  2% 1% 100% 2%
140Python 3 #3 1.951.9511,572664  100% 2% 2% 2%
140Python 3 #3 1.951.9611,332664  2% 15% 1% 85%
202Nuitka 2.822.8310,976322  8% 0% 65% 31%
202Nuitka 2.822.8311,216322  19% 2% 82% 2%
202Nuitka 2.832.8310,948322  100% 1% 1% 1%
205Python 3 2.872.879,872322  1% 100% 1% 0%
205Python 3 2.872.889,768322  1% 1% 100% 1%
206Python 3 2.872.889,868322  1% 0% 1% 100%
207Cython 2.902.909,600322  1% 1% 100% 2%
208Cython 2.912.919,636322  1% 1% 100% 4%
208PyPy 2 2.912.9287,400322  6% 1% 1% 100%
209Cython 2.922.929,628322  1% 100% 2% 2%
209PyPy 3 2.902.9375,720322  5% 99% 1% 1%
210PyPy 2 2.922.9487,368322  6% 100% 2% 1%
210PyPy 3 2.922.9475,856322  5% 1% 1% 99%
219PyPy 3 2.913.0675,776322  99% 1% 1% 0%
219Python development version 3.073.078,668322  0% 0% 100% 0%
220Python development version 3.083.088,488322  0% 100% 0% 1%
220Python development version 3.083.088,384322  1% 0% 100% 0%
221PyPy 2 2.923.0987,368322  99% 1% 2% 2%
229Python 2 3.203.207,236322  8% 3% 7% 100%
232Python 2 3.243.257,216322  9% 100% 6% 7%
242Python 2 3.383.397,468322  44% 14% 16% 73%
386Jython 8.845.40290,952322  34% 45% 51% 35%
389Jython 8.865.44294,580322  29% 51% 30% 54%
402Jython 9.425.63324,056322  47% 39% 41% 40%
906IronPython 13.1212.6877,680322  58% 2% 41% 2%
906IronPython 13.1512.6979,276322  1% 29% 5% 68%
906IronPython 13.1412.6978,604322  0% 57% 3% 42%
974MicroPython 13.3113.644,304322  30% 29% 52% 77%
987MicroPython 13.6713.824,180322  55% 45% 72% 36%
1,054MicroPython 14.1214.754,320322  56% 57% 76% 59%
missing benchmark programs
Shedskin No program
Numba No program
Grumpy No program
Graal 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