/mobile Handheld Friendly website

 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
1,000Failed  304   

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

Read mandelbrot benchmark to see what this program should do.

 notes

Python 3.4.0 (default, Mar 17 2014, 08:23:52) [GCC 4.8.1] on linux

 mandelbrot Python 3 #3 program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed by Tupteq
# 2to3 - fixed by Daniele Varrazzo

import sys

def main():
    cout = sys.stdout.buffer.write
    size = int(sys.argv[1])
    xr_size = range(size)
    xr_iter = range(50)
    bit = 128
    byte_acc = 0

    cout(("P4\n%d %d\n" % (size, size)).encode('ascii'))

    size = float(size)
    for y in xr_size:
        fy = 2j * y / size - 1j
        for x in xr_size:
            z = 0j
            c = 2. * x / size - 1.5 + fy

            for i in xr_iter:
                z = z * z + c
                if abs(z) >= 2.0:
                    break
            else:
                byte_acc += bit

            if bit > 1:
                bit >>= 1
            else:
                cout((byte_acc,))
                bit = 128
                byte_acc = 0

        if bit != 128:
            cout((byte_acc,))
            bit = 128
            byte_acc = 0

main()

 make, command-line, and program output logs

Tue, 18 Mar 2014 19:34:43 GMT

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

COMMAND LINE:
/usr/local/src/Python-3.4.0/bin/python3.4 mandelbrot.python3-3.py 1000

PROGRAM FAILED 


(BINARY) PROGRAM OUTPUT NOT SHOWN

Traceback (most recent call last):
  File "mandelbrot.python3-3.py", line 45, in <module>
    main()
  File "mandelbrot.python3-3.py", line 36, in main
    cout((byte_acc,))
TypeError: 'tuple' does not support the buffer interface

Revised BSD license

  Home   Conclusions   License   Play