Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

 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
157.5147.071,235,176367  34% 24% 27% 23% 74% 34% 19% 19%

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

 Mon, 20 Sep 2021 15:01:55 GMT

COMMAND LINE:
 /usr/lib/jvm/java-8-graalvm/bin/graalpython iobench.graal 1

PROGRAM OUTPUT NOT CHECKED:
<function fread at 0x1b014551> 100 bytes, 1.16us per write
<function fwrite at 0x25fd4e8c> 100 bytes, 1.04us per write
<function fread at 0x1b014551> 1000 bytes, 1.55us per write
<function fwrite at 0x25fd4e8c> 1000 bytes, 1.51us per write
<function fread at 0x1b014551> 10000 bytes, 2.75us per write
<function fwrite at 0x25fd4e8c> 10000 bytes, 12.63us per write
<function file_read at 0x6e97dd52> 100 bytes, 2.06us per write
<function file_write at 0x5de0096> 100 bytes, 3.18us per write
<function file_read at 0x6e97dd52> 1000 bytes, 5.57us per write
<function file_write at 0x5de0096> 1000 bytes, 13.40us per write
<function file_read at 0x6e97dd52> 10000 bytes, 41.13us per write
<function file_write at 0x5de0096> 10000 bytes, 115.80us per write

Revised BSD license

  Home   Conclusions   License   Play