/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one core |
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 |
|---|---|---|---|---|---|
| 10 | 17.67 | 88.35 | 4,568 | 385 | 0% 0% 0% 100% |
| 11 | 203.98 | 1,020.14 | 4,560 | 385 | 0% 0% 0% 100% |
| 12 | 2,903.20 | 3,204.31 | 4,564 | 385 | 0% 0% 0% 100% |
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.
Python 3.3.1 (default, Apr 11 2013, 12:56:47) [GCC 4.7.2] on linux
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # contributed by Isaac Gouy # converted to Java by Oleg Mazurov # converted to Python by Buck Golemon # modified by Justin Peel def fannkuch(n): maxFlipsCount = 0 permSign = True checksum = 0 perm1 = list(range(n)) count = perm1[:] rxrange = range(2, n - 1) nm = n - 1 while 1: k = perm1[0] if k: perm = perm1[:] flipsCount = 1 kk = perm[k] while kk: perm[:k+1] = perm[k::-1] flipsCount += 1 k = kk kk = perm[kk] if maxFlipsCount < flipsCount: maxFlipsCount = flipsCount checksum += flipsCount if permSign else -flipsCount # Use incremental change to generate another permutation if permSign: perm1[0],perm1[1] = perm1[1],perm1[0] permSign = False else: perm1[1],perm1[2] = perm1[2],perm1[1] permSign = True for r in rxrange: if count[r]: break count[r] = r perm0 = perm1[0] perm1[:r+1] = perm1[1:r+2] perm1[r+1] = perm0 else: r = nm if not count[r]: print( checksum ) return maxFlipsCount count[r] -= 1 from sys import argv n = int(argv[1]) print(( "Pfannkuchen(%i) = %i" % (n, fannkuch(n)) ))
Fri, 12 Apr 2013 07:42:09 GMT MAKE: mv fannkuchredux.python3-6.python3 fannkuchredux.python3-6.py 0.01s to complete and log all make actions COMMAND LINE: /usr/local/src/Python-3.3.1/bin/python3.3 fannkuchredux.python3-6.py 12 PROGRAM OUTPUT: 3968050 Pfannkuchen(12) = 65