Each chart bar shows how many times slower, one ↓ thread-ring program was, compared to the fastest program.
These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.
Column × shows how many times more each program used compared to the benchmark program that used least.
|×||Program Source Code||CPU secs||Elapsed secs||Memory KB||Code B||≈ CPU Load|
|1.0||PyPy 2||0.14||0.17||?||407||88% 0% 0% 6%|
|1.0||PyPy 3 #3||0.15||0.17||?||407||0% 6% 0% 89%|
|1.1||PyPy 3||0.16||0.18||?||407||6% 0% 89% 0%|
|2.1||Cython||0.35||0.35||1,708||419||6% 3% 100% 3%|
|3.5||Python 2||0.55||0.58||6,964||407||100% 3% 0% 0%|
|5.6||Pyston||0.89||0.93||26,664||407||100% 2% 0% 1%|
|19||Jython||7.06||3.10||3,504||407||72% 53% 65% 47%|
|139||PyPy 3 #2||32.08||22.92||71,712||448||32% 32% 25% 39%|
|141||MicroPython #2||31.96||23.24||6,168||448||25% 37% 24% 37%|
|147||Nuitka #2||33.59||24.30||14,372||448||31% 36% 23% 35%|
|148||Python development version #2||33.41||24.34||12,340||448||32% 35% 24% 34%|
|150||Python 3 #2||33.88||24.73||13,388||448||35% 31% 25% 33%|
|missing benchmark programs|
diff program output N = 1000 with this output file to check your program is correct before contributing.
Each program should create and keep alive 503 pre-emptive threads, explicity or implicitly linked in a ring, and pass a token between one thread and the next thread at least N times.
We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.
Each program should
Similar benchmarks are described in Performance Measurements of Threads in Java and Processes in Erlang, 1998; and A Benchmark Test for BCPL Style Coroutines, 2004. (Note: 'Benchmarks that may seem to be concurrent are often sequential. The estone benchmark, for instance, is entirely sequential. So is also the most common implementation of the "ring benchmark'; usually one process is active, while the others wait in a receive statement.') For some language implementations increasing the number of threads quickly results in Death by Concurrency.
Programs may use pre-emptive kernel threads or pre-emptive lightweight threads; but programs that use non pre-emptive threads (coroutines, cooperative threads) and any programs that use custom schedulers, will be listed as interesting alternative implementations. Briefly say what concurrency technique is used in the program header comment.