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 2 #4 0.020.02?380  50% 0% 100% 0%
1.9Python development version #4 0.030.03?379  0% 100% 0% 0%
1.9Python development version #4 0.030.03?379  0% 0% 100% 0%
1.9Cython #4 0.030.03?349  0% 33% 75% 0%
1.9Python 3 #4 0.030.03?379  0% 0% 100% 0%
1.9Python 3 #4 0.030.03?379  0% 100% 0% 0%
1.9Cython #4 0.030.03?349  0% 0% 100% 0%
1.9Cython #4 0.030.03?349  0% 0% 100% 0%
1.9Python 3 #4 0.030.03?379  0% 67% 50% 25%
2.1Python development version #4 0.030.03?379  75% 0% 0% 0%
2.5Nuitka #4 0.030.04?379  0% 25% 100% 0%
2.5Nuitka #4 0.030.04?379  0% 0% 100% 25%
2.7Nuitka #4 0.030.04?379  25% 0% 80% 67%
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%
68Python development version #5 0.950.9511,072710  100% 0% 1% 0%
68Python development version #5 0.950.9510,968710  3% 1% 100% 1%
68Python development version #5 0.950.9510,976710  1% 2% 1% 99%
68Python 3 #5 0.950.9511,156710  9% 3% 2% 100%
69Nuitka #5 0.960.9712,076710  45% 5% 56% 5%
69Python 3 #5 0.970.9711,040710  7% 6% 100% 4%
70Nuitka #5 0.970.9812,268710  96% 13% 7% 5%
71Python 3 #5 0.951.0011,040710  100% 7% 2% 1%
72Nuitka #5 0.961.0112,000710  3% 99% 5% 2%
73Cython #2 1.021.0310,808364  0% 9% 100% 1%
73Python 2 #2 1.021.038,884389  100% 1% 2% 1%
73Cython #2 1.031.0310,796364  0% 8% 100% 4%
74Python 3 #2 1.031.0411,120389  8% 100% 1% 1%
74Python development version #2 1.031.0411,056389  100% 1% 1% 3%
74Python development version #2 1.041.0411,032389  100% 3% 1% 1%
74Nuitka #2 1.041.0411,988389  1% 10% 100% 1%
74Python 2 #2 1.041.048,820389  2% 3% 100% 3%
74Python development version #2 1.041.0411,088389  2% 74% 1% 25%
74Nuitka #2 1.041.0411,960389  1% 9% 100% 2%
75Cython #2 1.051.0510,812364  3% 10% 3% 100%
76Python 3 #2 1.041.0611,108389  37% 69% 2% 4%
77Python 2 #2 1.071.088,972389  7% 99% 8% 9%
77Nuitka #2 1.031.0812,172389  2% 100% 6% 1%
78Python 3 #2 1.041.0910,948389  100% 0% 2% 5%
138Python development version #3 1.941.9410,964664  100% 1% 0% 4%
139Python development version #3 1.941.9411,012664  1% 1% 100% 2%
139Python development version #3 1.941.9411,084664  1% 2% 3% 100%
139Python 2 #3 1.941.948,972664  100% 3% 1% 1%
139Python 2 #3 1.941.949,020664  100% 2% 1% 2%
139Nuitka #3 1.941.9412,144664  1% 5% 99% 4%
139Python 3 #3 1.941.9511,004664  6% 1% 1% 100%
139Python 2 #3 1.941.959,268664  1% 99% 2% 2%
140Nuitka #3 1.951.9612,056664  4% 8% 99% 1%
140Python 3 #3 1.961.9611,028664  6% 6% 3% 100%
140Cython #3 1.961.9610,884639  2% 10% 3% 99%
141Cython #3 1.961.9711,108639  91% 12% 17% 5%
141Cython #3 1.971.9810,916639  8% 10% 7% 100%
142Python 3 #3 1.991.9911,008664  7% 2% 100% 1%
145Nuitka #3 1.942.0312,168664  2% 100% 4% 1%
206Python development version 2.892.899,456322  100% 1% 0% 0%
207Python development version 2.892.899,508322  100% 1% 1% 1%
207Python development version 2.892.909,488322  1% 100% 1% 1%
207Python 3 2.902.909,448322  5% 100% 1% 2%
208Cython 2.912.919,348322  4% 6% 2% 100%
208PyPy 2 2.912.9287,400322  6% 1% 1% 100%
209Nuitka 2.922.9210,408322  2% 9% 100% 1%
209Nuitka 2.922.9310,580322  3% 7% 0% 100%
209PyPy 3 2.902.9375,720322  5% 99% 1% 1%
210Cython 2.932.949,504322  2% 9% 1% 100%
210PyPy 2 2.922.9487,368322  6% 100% 2% 1%
210PyPy 3 2.922.9475,856322  5% 1% 1% 99%
210Python 3 2.942.959,492322  7% 3% 100% 1%
211Cython 2.952.969,444322  6% 10% 100% 6%
212Python 3 2.962.969,332322  8% 37% 72% 3%
217Nuitka 2.903.0310,340322  3% 100% 1% 1%
219PyPy 3 2.913.0675,776322  99% 1% 1% 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