performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
14.854.868,528367  2% 1% 1% 100%
14.864.868,468367  2% 1% 100% 0%
14.814.818,440367  1% 100% 0% 1%

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

Read iobench benchmark to see what this program should do.

 notes

 iobench Python dev program source code

import os, time

def measure(func, repetitions, size):
    t0 = time.time()
    func(repetitions, size)
    print(
        func,
        "%d bytes, %.2fus per write" % (
            size,
            (time.time() - t0) / repetitions * 1000 * 1000
        )
    )

def fwrite(repetitions, size):
    fd = os.open("/dev/null", os.O_WRONLY)
    for i in range(repetitions):
        os.write(fd, b" " * size)

def fread(repetitions, size):
    fd = os.open("/dev/full", os.O_RDONLY)
    for i in range(repetitions):
        os.read(fd, size)

def file_write(repetitions, size):
    f = open("/dev/null", "w")
    for i in range(repetitions):
        f.write(" " * size)
    f.flush()

def file_read(repetitions, size):
    f = open("/dev/full")
    for i in range(repetitions):
        f.read(size)

if __name__ == '__main__':
    measure(fread, 1000000, 100)
    measure(fwrite, 1000000, 100)
    measure(fread, 1000000, 1000)
    measure(fwrite, 1000000, 1000)
    measure(fread, 100000, 10000)
    measure(fwrite, 100000, 10000)
    measure(file_read, 1000000, 100)
    measure(file_write, 1000000, 100)
    measure(file_read, 1000000, 1000)
    measure(file_write, 1000000, 1000)
    measure(file_read, 100000, 10000)
    measure(file_write, 100000, 10000)

 make, command-line, and program output logs

Wed, 12 Sep 2018 09:12:24 GMT

COMMAND LINE:
/usr/bin/python3.7 iobench.python-dev 1

PROGRAM OUTPUT NOT CHECKED:
<function fread at 0x7f740e98a950> 100 bytes, 0.60us per write
<function fwrite at 0x7f740e98a840> 100 bytes, 0.60us per write
<function fread at 0x7f740e98a950> 1000 bytes, 0.68us per write
<function fwrite at 0x7f740e98a840> 1000 bytes, 0.69us per write
<function fread at 0x7f740e98a950> 10000 bytes, 1.13us per write
<function fwrite at 0x7f740e98a840> 10000 bytes, 0.80us per write
<function file_read at 0x7f740e98a730> 100 bytes, 0.19us per write
<function file_write at 0x7f740e98a7b8> 100 bytes, 0.23us per write
<function file_read at 0x7f740e98a730> 1000 bytes, 0.66us per write
<function file_write at 0x7f740e98a7b8> 1000 bytes, 0.47us per write
<function file_read at 0x7f740e98a730> 10000 bytes, 3.88us per write
<function file_write at 0x7f740e98a7b8> 10000 bytes, 1.48us per write

Revised BSD license

  Home   Conclusions   License   Play