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 thread-ring benchmark to see what this program should do.
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # # contributed by Daniel Nanz 2008-03-11 # Coroutines via enhanced generators # 2to3 import sys import itertools def main(n = int(sys.argv), n_threads=503, cycle=itertools.cycle): def worker(worker_id): n = 1 while True: if n > 0: n = (yield (n - 1)) else: print(worker_id) raise StopIteration threadRing = [worker(w) for w in range(1, n_threads + 1)] for t in threadRing: foo = next(t) # start exec. gen. funcs sendFuncRing = [t.send for t in threadRing] # speed... for send in cycle(sendFuncRing): try: n = send(n) except StopIteration: break main()
Thu, 18 Jun 2020 09:36:17 GMT COMMAND LINE: /usr/lib/jvm/java-8-graalvm/bin/graalpython threadring.graal-3.graal 5000000 PROGRAM FAILED PROGRAM OUTPUT: 181 Please note: This Python implementation is in the very early stages, and can run little more than basic benchmarks at this point. StopIteration The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/dundee/workspace/benchmarksgame/bencher/programs/threadring/threadring.python3-3.python3", line 34, in <module 'threadring.python3-3.python3'> main() File "/home/dundee/workspace/benchmarksgame/bencher/programs/threadring/threadring.python3-3.python3", line 14, in worker def worker(worker_id): RuntimeError: generator raised StopIteration