How big is the measured performance difference?

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

 thread-ring benchmark N=50,000,000

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.

Compare how much Memory the thread-ring programs used - sort Memory KB. Compare how much Code the programs used - sort Code B

Column × shows how many times more each program used compared to the program that used least.

    sort sort sort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
1.0Haskell GHC #3 6.106.102,944274  0% 0% 0% 100%
1.2Erlang HiPE 7.547.549,068273  99% 0% 1% 1%
3.4Go 6g 8g 20.5820.583,284309  0% 0% 0% 100%
3.4Go 6g 8g #3 20.5920.593,272347  0% 0% 0% 100%
4.0Java 6 -server #4 24.3724.40289,972894  0% 0% 0% 100%
4.3GNU gcc #3 26.2226.2217,032607  0% 0% 0% 100%
4.6Smalltalk VisualWorks #2 27.9327.9323,928566  0% 0% 0% 100%
14Pascal Free Pascal 86.3386.334,744523  0% 0% 0% 100%
17GNU gcc #2 101.45101.452,708575  0% 1% 0% 100%
17Scheme PLT 104.62104.6231,712262  0% 0% 0% 100%
17GNU gcc 105.37105.364,704487  0% 0% 0% 100%
18ATS 109.94109.934,7881090  0% 0% 0% 100%
18C++ GNU g++ #2 111.60111.605,356588  0% 0% 0% 100%
20Scala 124.24124.37396,404339  0% 0% 0% 100%
22OCaml #2 135.84135.837,300350  0% 0% 0% 100%
23Go 6g 8g #2 139.69139.693,380333  0% 0% 0% 100%
24OCaml #3 145.53145.525,296296  0% 0% 0% 100%
27C++ GNU g++ 166.28166.275,380636  0% 0% 0% 100%
28Python CPython #2 173.11173.108,236287  0% 0% 0% 100%
34Lisp SBCL #2 204.70204.6868,392571  0% 0% 0% 100%
36Java 6 -server #3 218.72218.73349,520530  0% 0% 0% 100%
43C# Mono 262.39262.3813,176476  0% 0% 0% 100%
43Ada 2005 GNAT #2 264.85264.859,836560  0% 0% 0% 100%
50Ada 2005 GNAT 5 min5 min9,768602  0% 0% 0% 100%
52Java 6 -Xint #3 5 min5 min53,472530  0% 0% 0% 100%
61Ruby JRuby 6 min6 min104,804342  0% 0% 0% 100%
65F# Mono 6 min6 min15,128472  0% 1% 0% 100%
66OCaml 6 min6 min8,504282  0% 0% 0% 100%
81Ruby JRuby #2 8 min8 min91,748228  0% 0% 0% 100%
82Perl #3 8 min8 min842,292489  0% 0% 0% 100%
140Java 6 -Xint #4 14 min14 min96,812894  0% 0% 0% 100%
240Perl 24 min24 min278,296353  0% 0% 0% 100%
293Ruby MRI #2 29 min29 min14,760228  0% 0% 0% 100%
506Ruby MRI 51 min51 min13,984342  0% 0% 0% 100%
Lisp SBCL Timed Out1h 00 min618
interesting alternative programs
0.2Java 6 -server #6 1.341.48216,348543
0.9Java 6 -server #2 5.205.2135,428693
2.1Java 6 -server #5 12.4812.53166,356432
2.3Lua #3 14.1614.171,644264
2.5Lua 15.0715.071,736255
2.5Python CPython #3 15.4615.474,008272
2.6Lua #2 15.8215.821,672284
missing programs
Clean No program
Fortran Intel No program
Java 6 steady state No program
JavaScript TraceMonkey 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 threads, explicity or implicitly linked in a ring, and pass a token between one thread and the next thread at least N times.

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. For some language implementations increasing the number of threads quickly results in Death by Concurrency.

Programs may use kernel threads, lightweight threads; but coroutines, cooperative threads and other programs with custom schedulers will be listed as interesting alternative implementations. Briefly say what concurrency technique is used in the program header comment.

Revised BSD license