performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
14.824.8279,516384  0% 0% 100% 0%
15.015.0179,572384  0% 96% 0% 4%
14.884.8880,276384  0% 0% 100% 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 Numba program source code

import os, time

from numba import jit


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
        )
    )

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

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

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

@jit
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

Fri, 10 Nov 2017 19:15:25 GMT

COMMAND LINE:
/opt/anaconda/bin/python iobench.numba 1

PROGRAM OUTPUT NOT CHECKED:
CPUDispatcher(<function fread at 0x7fbe0f79da60>) 100 bytes, 0.54us per write
CPUDispatcher(<function fwrite at 0x7fbe0f79d7b8>) 100 bytes, 0.50us per write
CPUDispatcher(<function fread at 0x7fbe0f79da60>) 1000 bytes, 0.46us per write
CPUDispatcher(<function fwrite at 0x7fbe0f79d7b8>) 1000 bytes, 0.44us per write
CPUDispatcher(<function fread at 0x7fbe0f79da60>) 10000 bytes, 0.93us per write
CPUDispatcher(<function fwrite at 0x7fbe0f79d7b8>) 10000 bytes, 0.61us per write
CPUDispatcher(<function file_read at 0x7fbe0f564268>) 100 bytes, 0.35us per write
CPUDispatcher(<function file_write at 0x7fbe0f564158>) 100 bytes, 0.38us per write
CPUDispatcher(<function file_read at 0x7fbe0f564268>) 1000 bytes, 0.70us per write
CPUDispatcher(<function file_write at 0x7fbe0f564158>) 1000 bytes, 0.53us per write
CPUDispatcher(<function file_read at 0x7fbe0f564268>) 10000 bytes, 3.66us per write
CPUDispatcher(<function file_write at 0x7fbe0f564158>) 10000 bytes, 1.47us per write

Revised BSD license

  Home   Conclusions   License   Play