# Python Interpreters Benchmarksx64 ArchLinux : AMD® Ryzen 7 4700U®

## performance measurements

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

N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
104.050.5614,572894  93% 89% 82% 89% 96% 91% 89% 91%

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

Read fannkuch-redux benchmark to see what this program should do.

## fannkuch-redux Nuitka #3 program source code

```# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed by Joerg Baumann
# many thanks to Oleg Mazurov for his helpful description

from sys import argv
from math import factorial
from multiprocessing import cpu_count, Pool
from itertools import islice, starmap

def permutations(n, start, size):
p = bytearray(range(n))

remainder = start
for v in range(n - 1, 0, -1):
rotation_count, remainder = divmod(remainder, factorial(v))
for _ in range(rotation_count):
p[:v], p[v] = p[1:v + 1], p

if size < 2:
yield p[:]
else:
rotations = [(v, factorial(v)) for v in range(3, n)]
for i in range(start + 2, start + size + 2, 2):
yield p[:]
p, p = p, p
yield p[:]
p, p = p, p
for v, modulo in rotations:
if i % modulo != 0:
break
p[:v], p[v] = p[1:v + 1], p

def alternating_flips_generator(n, start, size):
maximum_flips = 0
alternating_factor = 1
for permutation in permutations(n, start, size):
first = permutation
if first:
flips_count = 1
while True:
permutation[:first + 1] = permutation[first::-1]
first = permutation
if not first: break
flips_count += 1
if maximum_flips < flips_count:
maximum_flips = flips_count
yield flips_count * alternating_factor
else:
yield 0
alternating_factor = -alternating_factor
yield maximum_flips

alternating_flips = alternating_flips_generator(n, start, size)
return sum(islice(alternating_flips, size)), next(alternating_flips)

def fannkuch(n):
assert(n > 0)

total = factorial(n)

with Pool() as pool:
else:

checksum, maximum = sum(checksums), max(maximums)
print("{0}\nPfannkuchen({1}) = {2}".format(checksum, n, maximum))

if __name__ == "__main__":
fannkuch(int(argv))
```

### make, command-line, and program output logs

``` Wed, 19 Jan 2022 22:28:19 GMT

MAKE:
make: Vstupuje se do adresáře „/home/dundee/work/pybenchmarks/bencher/tmp/fannkuchredux/tmp“
nuitka3 --remove-output fannkuchredux.nuitka-3.nuitka
Nuitka-Options:INFO: Used command line options: --remove-output fannkuchredux.nuitka-3.nuitka
Nuitka-Options:WARNING: You did not specify to follow or include anything but main program. Check options and make sure that is intended.
Nuitka:INFO: Starting Python compilation with Nuitka '0.6.19.3' on Python '3.10' commercial None.
Nuitka-Plugins:WARNING: Use '--enable-plugin=multiprocessing' for: Multiprocessing workarounds for compiled code.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:WARNING: You are not using ccache.
Nuitka:INFO: Removing build directory 'fannkuchredux.nuitka-3.nuitka.build'.
Nuitka:INFO: Successfully created 'fannkuchredux.nuitka-3.nuitka.bin'.
cp fannkuchredux.nuitka-3.nuitka.bin fannkuchredux.nuitka-3.nuitka_run