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 | sort | sort | ||||
× | Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
---|---|---|---|---|---|---|
1.0 | Python development version #4 | 0.01 | 0.02 | ? | 379 | 33% 100% 0% 0% 0% 0% 0% 0% |
1.5 | Cython #4 | 0.02 | 0.02 | ? | 349 | 0% 0% 100% 0% 0% 33% 0% 0% |
1.9 | Python 3 #4 | 0.03 | 0.03 | ? | 379 | 25% 0% 100% 0% 0% 0% 33% 25% |
2.0 | Nuitka #4 | 0.03 | 0.03 | ? | 379 | 0% 75% 0% 0% 0% 0% 0% 0% |
32 | Python development version #5 | 0.48 | 0.49 | 11,392 | 710 | 100% 0% 0% 0% 4% 2% 0% 0% |
33 | Nuitka #5 | 0.49 | 0.50 | 13,168 | 710 | 6% 0% 2% 0% 94% 0% 4% 0% |
34 | Python 3 #5 | 0.50 | 0.51 | 12,604 | 710 | 2% 100% 0% 0% 0% 0% 0% 2% |
34 | Nuitka #2 | 0.51 | 0.51 | 13,312 | 389 | 98% 0% 0% 0% 0% 0% 2% 0% |
37 | Python development version #2 | 0.56 | 0.56 | 11,336 | 389 | 0% 0% 100% 0% 4% 2% 0% 2% |
39 | Cython #2 | 0.59 | 0.59 | 11,024 | 364 | 2% 0% 0% 0% 2% 0% 98% 0% |
41 | Python 3 #2 | 0.61 | 0.62 | 12,792 | 389 | 5% 0% 2% 0% 2% 2% 2% 100% |
69 | Nuitka #3 | 1.03 | 1.04 | 13,512 | 664 | 3% 1% 1% 0% 1% 1% 0% 100% |
71 | Python development version #3 | 1.07 | 1.07 | 11,632 | 664 | 0% 0% 0% 99% 2% 2% 1% 0% |
72 | Cython #3 | 1.08 | 1.08 | 11,172 | 639 | 1% 0% 0% 0% 100% 0% 0% 0% |
74 | Python 3 #3 | 1.11 | 1.11 | 12,640 | 664 | 95% 0% 1% 1% 6% 0% 0% 0% |
91 | RustPython | 1.37 | 1.37 | 16,132 | 322 | 0% 1% 0% 0% 0% 1% 100% 1% |
134 | Python development version | 2.01 | 2.02 | 9,924 | 322 | 1% 0% 100% 0% 1% 0% 1% 0% |
135 | Cython | 2.02 | 2.03 | 9,528 | 322 | 100% 0% 0% 0% 2% 0% 0% 0% |
138 | Pyston | 2.07 | 2.07 | 9,304 | 322 | 1% 100% 0% 0% 0% 0% 0% 1% |
141 | Nuitka | 2.11 | 2.12 | 11,836 | 322 | 1% 0% 0% 100% 2% 1% 0% 0% |
142 | Python 2 | 2.13 | 2.13 | 7,128 | 322 | 0% 0% 0% 0% 1% 0% 100% 0% |
144 | Python 3 | 2.16 | 2.17 | 10,980 | 322 | 1% 100% 0% 0% 0% 0% 0% 1% |
189 | PyPy 3 | 2.84 | 2.84 | 75,604 | 322 | 76% 2% 0% 0% 1% 24% 1% 0% |
199 | PyPy 2 | 2.98 | 2.99 | 81,732 | 322 | 100% 0% 0% 0% 1% 0% 0% 0% |
411 | Graal | 8.15 | 6.17 | 803,816 | 322 | 0% 93% 9% 0% 6% 16% 4% 7% |
430 | Jython | 10.77 | 6.45 | 3,588 | 322 | 18% 30% 55% 20% 13% 7% 13% 12% |
744 | MicroPython | 11.15 | 11.16 | 3,744 | 322 | 1% 0% 1% 0% 0% 100% 0% 1% |
missing benchmark programs | ||||||
IronPython | No program | |||||
Shedskin | No program | |||||
Numba | No program | |||||
Grumpy | No program |
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