performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
120.1420.1526,780370  0% 4% 100% 8%
120.1220.1226,684370  0% 61% 0% 39%
120.3420.3426,752370  100% 0% 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 Pyston program source code

import os, time

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

def fwrite(num, num2):
    fd = os.open("/dev/null", os.O_WRONLY)
    for i in xrange(num):
        os.write(fd, " " * num2)

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

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

def file_read(num, num2):
    f = open("/dev/full")
    for i in xrange(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

Fri, 10 Nov 2017 19:22:13 GMT

COMMAND LINE:
/usr/bin/pyston iobench.pyston 1

PROGRAM OUTPUT NOT CHECKED:
fread 100 bytes, 0.24us per write
fwrite 100 bytes, 0.26us per write
fread 1000 bytes, 0.30us per write
fwrite 1000 bytes, 0.28us per write
fread 10000 bytes, 0.78us per write
fwrite 10000 bytes, 0.44us per write
file_read 100 bytes, 0.13us per write
file_write 100 bytes, 0.12us per write
file_read 1000 bytes, 0.22us per write
file_write 1000 bytes, 0.18us per write
file_read 10000 bytes, 0.93us per write
file_write 10000 bytes, 0.56us per write

Revised BSD license

  Home   Conclusions   License   Play