performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
10.020.02?366  33% 100% 0% 0%
10.020.02?366  0% 100% 0% 0%
10.020.02?366  0% 100% 0% 0%

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 Cython program source code

import os, time

cdef measure(func, int num1, int num2):
    t0 = time.time()
    func(num1, num2)
    print(
        func, 
        "%d bytes, %.2fus per write" % (
            num2, 
            (time.time() - t0) / num1 * 1000 * 1000
        )
    )

cdef fwrite(int num, int num2):
    fd = os.open("/dev/null", os.O_WRONLY)
    for i in range(num):
        os.write(fd, b" " * num2)

cdef fread(int num, int num2):
    fd = os.open("/dev/full", os.O_RDONLY)
    for i in range(num):
        os.read(fd, num2)

cdef file_write(int num, int num2):
    f = open("/dev/null", "w")
    for i in range(num):
        f.write(" " * num2)
    f.flush()

cdef file_read(int num, int num2):
    f = open("/dev/full")
    for i in range(num):
        f.read(num2)

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

 make, command-line, and program output logs

Mon, 15 Oct 2018 12:12:54 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp“
cp iobench.cython `echo iobench.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
cythonize -3 -bi `echo iobench.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
Compiling /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.pyx because it changed.
[1/1] Cythonizing /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.pyx
running build_ext
building 'iobench' extension
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher/tmp
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -I/usr/include/python3.7m -c /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.c -o /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/tmp_ze1tq1y/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.o -L/usr/lib -lpython3.7m -o /home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp/iobench.cpython-37m-x86_64-linux-gnu.so
make[1]: Opouští se adresář „/home/dundee/workspace/benchmarksgame/bencher/tmp/iobench/tmp“
2.97s to complete and log all make actions

COMMAND LINE:
/usr/bin/python3 -c "import iobench" 1

PROGRAM OUTPUT NOT CHECKED:

Revised BSD license

  Home   Conclusions   License   Play