Python Interpreters Benchmarks
x64 ArchLinux : Intel® i5-7200U®

 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.140.17?407  88% 0% 0% 6%
1.0PyPy 3 #3 0.150.17?407  0% 6% 0% 89%
1.1PyPy 3 0.160.18?407  6% 0% 89% 0%
2.1Cython 0.350.351,708419  6% 3% 100% 3%
3.5Python 2 0.550.586,964407  100% 3% 0% 0%
5.6Pyston 0.890.9326,664407  100% 2% 0% 1%
19Jython 7.063.103,504407  72% 53% 65% 47%
139PyPy 3 #2 32.0822.9271,712448  32% 32% 25% 39%
141MicroPython #2 31.9623.246,168448  25% 37% 24% 37%
147Nuitka #2 33.5924.3014,372448  31% 36% 23% 35%
148Python development version #2 33.4124.3412,340448  32% 35% 24% 34%
150Python 3 #2 33.8824.7313,388448  35% 31% 25% 33%
missing benchmark programs
IronPython No program
Shedskin No program
Numba No program
Grumpy No program
Graal No program
RustPython 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