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

 performance measurements

Each table row shows performance measurements for this Pyston program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load

Read the ↓ make, command line, and program output logs to see how this program was run.

Read pidigits benchmark to see what this program should do.

 notes

 pidigits Pyston #4 program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed Daniel Nanz

import sys
try:
    import gmpy2 as gmpy
except ImportError:
    import gmpy_cffi as gmpy

if not hasattr(gmpy, 'pi'):
    gmpy.pi = gmpy.const_pi

def get_pistring(n, pi=gmpy.pi):

    return str(pi(int(3.35 * n))).replace('.', '')[0 : n]


def main(n, width=10, line='{}\t:{}'):

    pistring = get_pistring(n)
    for i in range(0, n - width + 1, width):
        print(line.format(pistring[i : i + width], i + width))
    if n % width > 0:
        print(line.format(pistring[-(n % width) : ].ljust(width), n))


main(int(sys.argv[1]))

 make, command-line, and program output logs

 Thu, 06 May 2021 22:44:40 GMT

COMMAND LINE:
 /usr/bin/pyston pidigits.pyston-4.pyston 10000

PROGRAM FAILED 


PROGRAM OUTPUT:

Traceback (most recent call last):
  File "pidigits.pyston-4.pyston", line 8, in <module>
    import gmpy2 as gmpy
ModuleNotFoundError: No module named 'gmpy2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pidigits.pyston-4.pyston", line 10, in <module>
    import gmpy_cffi as gmpy
ModuleNotFoundError: No module named 'gmpy_cffi'

Revised BSD license

  Home   Conclusions   License   Play