Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

 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 development version #4 0.010.02?379  33% 100% 0% 0% 0% 0% 0% 0%
1.5Cython #4 0.020.02?349  0% 0% 100% 0% 0% 33% 0% 0%
1.9Python 3 #4 0.030.03?379  25% 0% 100% 0% 0% 0% 33% 25%
2.0Nuitka #4 0.030.03?379  0% 75% 0% 0% 0% 0% 0% 0%
32Python development version #5 0.480.4911,392710  100% 0% 0% 0% 4% 2% 0% 0%
33Nuitka #5 0.490.5013,168710  6% 0% 2% 0% 94% 0% 4% 0%
34Python 3 #5 0.500.5112,604710  2% 100% 0% 0% 0% 0% 0% 2%
34Nuitka #2 0.510.5113,312389  98% 0% 0% 0% 0% 0% 2% 0%
37Python development version #2 0.560.5611,336389  0% 0% 100% 0% 4% 2% 0% 2%
39Cython #2 0.590.5911,024364  2% 0% 0% 0% 2% 0% 98% 0%
41Python 3 #2 0.610.6212,792389  5% 0% 2% 0% 2% 2% 2% 100%
69Nuitka #3 1.031.0413,512664  3% 1% 1% 0% 1% 1% 0% 100%
71Python development version #3 1.071.0711,632664  0% 0% 0% 99% 2% 2% 1% 0%
72Cython #3 1.081.0811,172639  1% 0% 0% 0% 100% 0% 0% 0%
74Python 3 #3 1.111.1112,640664  95% 0% 1% 1% 6% 0% 0% 0%
91RustPython 1.371.3716,132322  0% 1% 0% 0% 0% 1% 100% 1%
134Python development version 2.012.029,924322  1% 0% 100% 0% 1% 0% 1% 0%
135Cython 2.022.039,528322  100% 0% 0% 0% 2% 0% 0% 0%
138Pyston 2.072.079,304322  1% 100% 0% 0% 0% 0% 0% 1%
141Nuitka 2.112.1211,836322  1% 0% 0% 100% 2% 1% 0% 0%
142Python 2 2.132.137,128322  0% 0% 0% 0% 1% 0% 100% 0%
144Python 3 2.162.1710,980322  1% 100% 0% 0% 0% 0% 0% 1%
189PyPy 3 2.842.8475,604322  76% 2% 0% 0% 1% 24% 1% 0%
199PyPy 2 2.982.9981,732322  100% 0% 0% 0% 1% 0% 0% 0%
411Graal 8.156.17803,816322  0% 93% 9% 0% 6% 16% 4% 7%
430Jython 10.776.453,588322  18% 30% 55% 20% 13% 7% 13% 12%
744MicroPython 11.1511.163,744322  1% 0% 1% 0% 0% 100% 0% 1%
missing benchmark programs
IronPython No program
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