performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
2,000Failed  248   

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

Python 3.4.3 (default, Apr 4 2015, 09:21:43) [GCC 4.8.2] on linux

 pidigits Python 3 #4 program source code

# The Computer Language Benchmarks Game

# http://benchmarksgame.alioth.debian.org/

#

# contributed Daniel Nanz


import sys
import gmpy2


def get_pistring(n, pi=gmpy2.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

Sun, 05 Apr 2015 05:45:17 GMT

MAKE:
mv pidigits.python3-4.python3 pidigits.python3-4.py
0.01s to complete and log all make actions

COMMAND LINE:
/usr/local/src/Python-3.4.3/bin/python3.4 pidigits.python3-4.py 2000

PROGRAM FAILED 


PROGRAM OUTPUT:

Traceback (most recent call last):
  File "pidigits.python3-4.py", line 10, in <module>
    def get_pistring(n, pi=gmpy2.pi):
AttributeError: 'module' object has no attribute 'pi'

Revised BSD license

  Home   Conclusions   License   Play