performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load

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

Tue, 14 May 2019 09:17:52 GMT

COMMAND LINE:
/usr/bin/graalpython iobench.graal 1

TIMED OUT after 300s


PROGRAM OUTPUT NOT CHECKED:
<function fread at 0x547932e3> 100 bytes, 1.67us per write
<function fwrite at 0xa8f72da> 100 bytes, 2.47us per write
<function fread at 0x547932e3> 1000 bytes, 1.52us per write
<function fwrite at 0xa8f72da> 1000 bytes, 13.77us per write
<function fread at 0x547932e3> 10000 bytes, 1.54us per write
<function fwrite at 0xa8f72da> 10000 bytes, 129.35us per write
<function file_read at 0x4dfc11d4> 100 bytes, 117.94us per write
<function file_write at 0xdf83ddb> 100 bytes, 92.99us per write

Please note: This Python implementation is in the very early stages, and can run little more than basic benchmarks at this point.

Revised BSD license

  Home   Conclusions   License   Play