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

 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

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

Read fibonacci benchmark to see what this program should do.

 notes

Python 3.3.1 (default, Apr 11 2013, 12:45:45)
[GCC 4.7.2] on linux

 fibonacci Python 3 #3 program source code

import sys


def powLF(n):
    if n == 1:
        return (1, 1)
    L, F = powLF(n//2)
    L, F = (L**2 + 5*F**2) >> 1, L*F
    if n & 1:
        return ((L + 5*F) >> 1, (L + F) >> 1)
    else:
        return (L, F)


def fib(n):
    if n & 1:
        return powLF(n)[1]
    else:
        L, F = powLF(n // 2)
        return L * F

print(fib(int(sys.argv[1])))

 make, command-line, and program output logs

 Sun, 30 Jul 2023 10:51:11 GMT

COMMAND LINE:
 /usr/bin/python3 fibonacci.python3-3.python3 1000000

PROGRAM FAILED 


PROGRAM OUTPUT:

Traceback (most recent call last):
  File "/home/dundee/work/pybenchmarks/bencher/tmp/fibonacci/tmp/fibonacci.python3-3.python3", line 22, in <module>
    print(fib(int(sys.argv[1])))
ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit

Revised BSD license

  Home   Conclusions   License   Play