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

 thread-ring benchmark N=5,000,000

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.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0PyPy 2 0.110.11?407  0% 8% 92% 0% 9% 0% 0% 8%
2.1Cython 0.230.233,120419  4% 0% 100% 0% 0% 0% 4% 4%
2.3PyPy 3 0.130.26128406  22% 15% 50% 38% 8% 8% 4% 4%
2.5Python development version 0.240.28384406  10% 10% 7% 93% 4% 0% 0% 0%
2.5Python 3 0.280.281,920406  100% 7% 0% 0% 4% 0% 0% 3%
3.1Nuitka 0.350.351,152406  17% 3% 3% 0% 100% 14% 16% 9%
3.4Python 2 0.380.392,800407  3% 3% 97% 0% 0% 0% 0% 0%
24Jython 5.842.663,476407  54% 23% 34% 24% 32% 24% 15% 20%
46RustPython 5.165.2015,540406  97% 4% 2% 1% 6% 3% 3% 3%
299MicroPython #2 15.4133.764,480448  6% 5% 6% 5% 5% 4% 6% 4%
316Python 3 #2 36.2135.6616,784448  8% 9% 12% 10% 14% 15% 10% 7%
317Nuitka #2 17.6435.8715,872448  9% 7% 5% 4% 5% 5% 6% 9%
320Python development version #2 36.2736.1713,476448  15% 13% 8% 18% 9% 10% 8% 9%
329PyPy 3 #2 28.6137.1773,036448  19% 7% 4% 3% 12% 24% 5% 15%
386Pyston #2 23.2043.6610,748448  17% 10% 7% 5% 7% 6% 7% 7%
482RustPython #2 43.4454.4917,884448  16% 14% 14% 17% 8% 10% 8% 6%
missing benchmark programs
IronPython No program
Shedskin No program
Numba No program
Grumpy No program
Graal No program

 thread-ring benchmark : Switch from thread to thread passing one token

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.

Revised BSD license

  Home   Conclusions   License   Play