/mobile Handheld Friendly website

 thread-ring benchmark N=50,000,000

Each chart bar shows how many times more Memory, one ↓ thread-ring program used, compared to the program that used least Memory.

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.

    sortsort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0OCaml #2 136.21136.28680350  0% 0% 0% 100%
3.6C gcc #2 126.16126.222,428575  0% 0% 0% 100%
3.7C++ g++ #5 8.158.162,508652  0% 0% 0% 100%
3.7C++ g++ #4 16.0616.072,548572  1% 0% 0% 100%
3.9Haskell GHC 9.059.062,652307  0% 1% 0% 100%
4.2Go #5 15.6215.632,852405  0% 1% 0% 100%
4.4OCaml #3 139.71139.782,984296  0% 0% 0% 100%
4.4C++ g++ 181.38181.493,016636  0% 0% 0% 100%
6.7ATS 130.81130.874,5361065  1% 0% 0% 100%
6.7C gcc 132.75132.824,540487  0% 0% 0% 100%
6.7C++ g++ #2 130.87130.954,540588  1% 0% 0% 100%
9.8Ada 2005 GNAT #4 178.08178.196,652960  1% 0% 0% 100%
9.8Ada 2005 GNAT #3 179.74179.866,652727  1% 0% 0% 100%
9.8Ada 2005 GNAT #2 298.86299.056,656560  0% 0% 0% 100%
9.8Ada 2005 GNAT 6 min6 min6,656602  0% 0% 0% 100%
9.8Python 3 #2 201.59201.686,672288  0% 0% 0% 100%
12OCaml 5 min5 min8,300282  0% 0% 0% 100%
22Ruby 2.0 #2 19 min19 min15,072215  0% 0% 0% 100%
24F# Mono #3 47.5447.5516,176329  0% 0% 0% 100%
24C# Mono 267.91268.0416,292476  0% 0% 0% 100%
28F# Mono #2 5 min5 min18,956555  0% 0% 0% 100%
33Smalltalk VisualWorks #2 48.8248.8422,480566  0% 0% 0% 100%
74Racket 155.93156.0350,444262  0% 0% 1% 100%
79Lisp SBCL #2 5 min5 min53,688571  0% 0% 0% 100%
395Erlang HiPE 11.0719.08268,880273  0% 0% 0% 59%
428Java 7  #3 224.77224.90290,860530  1% 0% 0% 100%
592Clojure #2 91.5091.59402,472299  0% 0% 0% 100%
602Clojure 93.9194.02409,528348  0% 0% 0% 100%
C CINT Failed487
C CINT #2 Failed575
C gcc #3 Failed916
C gcc #4 Timed Out10 min761
Lisp SBCL Timed Out5 min618
Pascal Free Pascal Make Error523
Perl #3 Failed489
Perl Failed353
Ruby 2.0 Failed331
Ruby JRuby #2 Failed228
Ruby JRuby Failed342
Scala Failed296
"wrong" (different) algorithm / less comparable programs
1.6Lua #3 19.2419.251,080264
3.7C++ g++ #3 16.1316.152,516726
6.7Python 3 #3 11.8411.854,572270
9.8Ada 2005 GNAT #5 0.540.556,6561476
23F# Mono #4 2.122.1315,552267
196Java 7  #5 18.1118.13133,192432
378Java 7  #4 33.7333.77257,208894
401Java 7  #6 1.081.10272,956543
402Java 7  #2 5.375.38273,408693
missing benchmark programs
Dart No program
Fortran Intel No program
JavaScript V8 No program
Lua No program
PHP 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